Gdi::GetNearestColor_I

This method returns the system palette color that will be displayed when the specified color value is used.

static WINGDIAPI COLORREF WINAPI GetNearestColor_I(
  HDC hdc, 
  COLORREF crColor
);

Parameters

  • hdc
    [in] Handle to the device context.
  • crColor
    [in] COLORREF value that specifies a requested color.

Return Values

If the function succeeds, the return value identifies a color from the system palette that corresponds to the specified color value.

If the function fails, the return value is CLR_INVALID.

To get extended error information, call GetLastError.

Remarks

This method is an internal version of the GetNearestColor function.

The Gdi::GetNearestColor_I method returns the color from the selected device context that most closely matches the specified color value.

Requirements

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

See Also

GetNearestColor | Gdi::GetDeviceCaps_I | COLORREF

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.