ReadPixel

Top  Previous  Next

Syntax

UINT = ReadPixel(x as INT,y as INT,opt buffer as POINTER)

Description

Returns the RGB color or palette index of a pixel at the specified coordinates.

Parameters

x, y - coordinates of the pixel to read.

buffer - Optional. Can be either BACKBUFFER (default) or FRONTBUFFER.

Return value

The RGB color, or palette index, of the pixel.

Remarks

Because of color conversions necessary with 16 and 24 bit screens the value read may be different then the value written. The screen automatically converts 32 bit RGB color to the proper pixel format and resolution of the red, green and blue components are adjusted accordingly.

For 8 bit screens the value returned is the palette index of the color.

See Also: WRITEPIXEL, WRITEPIXELFAST

Example usage

col = READPIXEL(100,10)