Home > Language Reference > Classes > Display

GetPixel Function

Queries the color of a given pixel.

Syntax

Public Function GetPixel(ByVal x As Integer, ByVal y As Integer) As Long

ParameterDescription
xX-coordinate of the pixel.
yY-coordinate of the pixel.

Remarks

The GetPixel function returns the color of the pixel located at the (x,y) coordinates. Calling this function automatically flushes any pending graphic operation, so that the pixel color can be determined in a synchronous way.

If the specified pixel lies outside the display, the special value -1 is returned. Otherwise, the returned value is a Long whose first byte contains the intensity of blue, the second the intensity of green and the third the intensity of red. For more information, refer to the Color Handling chapter.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A