Gdi::GetPixel_I

This method retrieves the red, green, blue (RGB) color value of the pixel at the specified coordinates.

static WINGDIAPI COLORREF WINAPI GetPixel_I(
  HDC hdc, 
  int nXPos, 
  int nYPos
);

Parameters

  • hdc
    [in] Handle to the device context.
  • nXPos
    [in] Integer that specifies the logical x-coordinate of the pixel to be examined.
  • nYPos
    [in] Integer that specifies the logical y-coordinate of the pixel to be examined.

Return Values

The RGB value of the pixel indicates success. CLR_INVALID indicates that the pixel is outside of the current clipping region.

Remarks

This method is an internal version of the GetPixel function.

The pixel must be within the boundaries of the current clipping region.

Not all devices support Gdi::GetPixel_I. An application should call Gdi::GetDeviceCaps_I to determine whether a specified device supports this function.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Gdi.hpp.

See Also

GetPixel | Gdi::GetDeviceCaps_I | Gdi::SetPixel_I

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.