Gdi::CreatePalette_I

This method creates a logical color palette.

static WINGDIAPI HPALETTE WINAPI CreatePalette_I(
  CONST LOGPALETTE* lplgpl
);

Parameters

  • lplgpl
    [in] Long pointer to a LOGPALETTE structure that contains information about the colors in the logical palette.

Return Values

A handle that identifies a logical palette indicates success. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

This method is an internal version of the CreatePalette function.

An application can determine whether a device supports palette operations by calling the Gdi::GetDeviceCaps_I method and specifying the RASTERCAPS constant.

Once an application creates a logical palette, the application can select that palette into a device context by calling the Gdi::SelectPalette_I method. You can realize a palette selected into a device context by calling the Gdi::RealizePalette_I method.

When you no longer need the palette, call the Gdi::DeleteObject_I method to delete the palette.

Because Windows CE does not arbitrate between the palettes of the foreground and background applications, Windows CE does not automatically pad palettes with system colors. Therefore, the number of color entries in the palette created by this function is always the same as the **palNumEntries**member of the LOGPALETTE structure.

Requirements

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

See Also

CreatePalette | Gdi::DeleteObject_I | Gdi::GetDeviceCaps_I | Gdi::RealizePalette_I | Gdi::SelectPalette_I | LOGPALETTE

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.