Gdi32GetPixel(IntPtr, Int32, Int32) Method

Retrieves the Red, Green, Blue (RGB) color value of the pixel at the specified coordinates.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("GDI32.dll")]
public static uint GetPixel(
	IntPtr hdc,
	int nXPos,
	int nYPos
)

Parameters

hdc  IntPtr
A IntPtr handle to the device context.
nXPos  Int32
The x-coordinate, in logical units, of the pixel to be examined.
nYPos  Int32
The y-coordinate, in logical units, of the pixel to be examined.

Return Value

UInt32
The return value is the COLORREF value that specifies the RGB of the pixel. If the pixel is outside of the current clipping region, the return value is CLR_INVALID (&HFFFFFFFF)

Remarks

See Also