GETPIXEL, GETPIXEL_W

Graphics Function: Returns the color index of the pixel at a specified location.

Module: USE DFLIB

Syntax

result = GETPIXEL (x, y)
result = GETPIXEL_W (wx, wy)


x, y
(Input) INTEGER(2). Viewport coordinates for pixel position.


wx, wy
(Input) REAL(8). Window coordinates for pixel position.

Results:

The result is of type INTEGER(2). The result is the pixel color index if successful; otherwise, -1 (if the pixel lies outside the clipping region, for example).

Color routines without the RGB suffix, such as GETPIXEL, use color indexes, not true color values, and limit you to colors in the palette, at most 256. To access all system colors, use SETPIXELRGB to specify an explicit Red-Green-Blue value and retrieve the value with GETPIXELRGB.


Note: The GETPIXEL routine described here is a QuickWin routine. If you are trying to use the Win32 SDK version of the GetPixel routine by including the DFWIN module, you need to specify the routine name as MSFWIN$GetPixel. For more information, see Special Naming Convention for Certain QuickWin and Win32 Graphics Routines in the Programmer's Guide.

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS LIB

See Also: GETPIXELRGB, GRSTATUS, REMAPALLPALETTERGB, REMAPPALETTERGB, SETCOLOR, GETPIXELS, SETPIXEL