PALETTEINDEX

3.0

  COLORREF PALETTEINDEX(wPaletteIndex)    
  WORD wPaletteIndex; /* index to palette entry */

The PALETTEINDEX macro accepts an index to a logical-color palette entry and returns a value consisting of 1 in the high-order byte and the palette-entry index in the low-order byte. This is called a palette-entry specifier. An application using a color palette can pass this specifier instead of an explicit RGB value to functions that expect a color. This allows the function to use the color in the specified palette entry.

Parameters

wPaletteIndex

Specifies an index to the palette entry containing the color to be used for a graphics operation.

Return Value

The return value is a logical-palette index specifier. When using a logical palette, an application can use this specifier in place of an explicit RGB value for graphics-device interface (GDI) functions that require a color.

Comments

The PALETTEINDEX macro is defined in WINDOWS.H as follows:

#define PALETTEINDEX(i)  ((COLORREF)(0x01000000L | (DWORD)(WORD)(i)))

See Also

PALETTERGB, RGB