RealizePalette

  UINT RealizePalette(hdc)    
  HDC hdc; /* handle of device context */

The RealizePalette function maps palette entries from the current logical palette to the system palette.

Parameters

hdc

Identifies the device context into which a logical palette has been selected.

Return Value

The return value specifies the number of entries in the logical palette that were mapped to in the system palette if the function is successful. Otherwise it is -1.

Comments

The RealizePalette function modifies the palette for the device associated with the given device context. If the device context is a memory DC, the color table for the bitmap selected into the DC is modified. If the device context is a display DC, 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 with colors displayed by other windows.

When an application's window has the focus and calls the RealizePalette function, Windows attempts to realize as many of the requested colors as possible. (This is also true for application's with inactive windows.)

See Also

GetDeviceCaps