A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



GetPixel

The GetPixel function retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.

VB4-32,5,6
Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

VB.NET
System.Drawing.Bitmap.GetPixel

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
Gdi32

Parameter Information
- hdc
Identifies the device context.

- nXPos
Specifies the logical x-coordinate of the pixel to be examined.

- nYPos
Specifies the logical y-coordinate of the pixel to be examined.

Return Values
If the function succeeds, the return value is an RGB value. If the pixel is outside of the current clipping region, the return value is CLR_INVALID.

Last update: 07 April 2006