Gdi32GetPixel(SafeHandle, Int32, Int32) Method
Retrieves the Red, Green, Blue (RGB) color value of the pixel at the specified coordinates.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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(
SafeHandle hdc,
int nXPos,
int nYPos
)
<DllImportAttribute("GDI32.dll">]
Public Shared Function GetPixel (
hdc As SafeHandle,
nXPos As Integer,
nYPos As Integer
) As UInteger
Dim hdc As SafeHandle
Dim nXPos As Integer
Dim nYPos As Integer
Dim returnValue As UInteger
returnValue = Gdi32.GetPixel(hdc,
nXPos, nYPos)
public:
[DllImportAttribute(L"GDI32.dll")]
static unsigned int GetPixel(
SafeHandle^ hdc,
int nXPos,
int nYPos
)
[<DllImportAttribute("GDI32.dll")>]
static member GetPixel :
hdc : SafeHandle *
nXPos : int *
nYPos : int -> uint32
No code example is currently available or this language may not be supported.
- hdc SafeHandle
-
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.
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)