Partager via


Gdi::RealizePalette_I

This method maps palette entries from the current logical palette to the system palette.

static WINGDIAPI unsigned int WINAPI RealizePalette_I(
  HDC hdc
);

Parameters

  • hdc
    [in] Handle to the device context into which you have selected a logical palette.

Return Values

The number of entries in the logical palette mapped to the system palette indicates success. GDI_ERROR indicates failure. To get extended error information, call GetLastError.

Remarks

This method is an internal version of the RealizePalette function.

Gdi::RealizePalette_I fails if the device associated with hdc does not have a settable palette. Call the Gdi::GetDeviceCaps_I method, specifying the RASTERCAPS constant, to determine if the device has a settable palette before calling Gdi::RealizePalette_I.

Gdi::RealizePalette_I modifies the palette for the device associated with the specified device context. If the device context is a memory device context, the color table for the bitmap selected into the device context is modified. If the device context is a display device context, the physical palette for that device is modified.

A logical color palette is a buffer between color-intensive applications and the system, allowing these applications to use as many colors as needed without interfering with colors displayed by other windows.

When the window for an application has the focus and the application calls Gdi::RealizePalette_I, the system attempts to realize as many of the requested colors as possible. This behavior also holds for applications with inactive windows.

Windows CE does not arbitrate between the palettes of the background and foreground applications. The foreground application has complete control of the system palette. Therefore, Windows CE does not perform any color matching operations for foreground applications; Windows CE simply overwrites the system palette entries with the palette entries for the hdc parameter*.*

Windows CE does not support Gdi::RealizePalette_I for background applications.

Requirements

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

See Also

RealizePalette | Gdi::GetDeviceCaps_I | Gdi::SelectPalette_I

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.