DIBINDEX macro

The DIBINDEX macro takes an index to an entry in a DIB color table and returns a COLORREF value that specifies the color associated with the given index. An application using a device context with a DIB section selected into it can pass this specifier, instead of an explicit red, green, blue (RGB) value, to GDI functions that expect a color. This allows the function to use the color at the specified color table index.

Syntax


LONG DIBINDEX(
   WORD wColorTableIndex
);

Parameters

wColorTableIndex

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

Return value

The return value is a color table index specifier in the form of a 32-bit COLORREF value.

Remarks

DIBINDEX indexes colors in a DIB color table in a manner similar to the way PALETTEINDEX indexes colors in a logical palette.

DIBINDEX also works with 16-bit bitmaps and device contexts (DCs).

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Mmsystem.h (include Windows.h)

See also

Colors Overview
Color Macros
COLORREF
PALETTEINDEX
RGB

 

 

Show: