| Herd Software Development
|=
DaVinci Graphics Library
|==
DaVinci Documentation Home Search Order


Leonardo: The DIBFromBitmap function

Creates a DIB from a DDB (Device Dependent Bitmap, represented as an HBITMAP) and its corresponding palette.

HDIB API DIBFromBitmap (
HBITMAP hbm,
DWORD biStyle,
WORD biBits,
HPALETTE hpal);

hbm Handle of the source bitmap.

The handle of the source bitmap remains valid after this operation.

biStyle Should be BI_RGB.

biBits Desired color depth (biBitCount of the DIB). Valid values include:
0 - as DDB
1 - monochrome
4 - 16 colors
8 - 256 colors
24 - TrueColor (16M colors)

hpal Color palette used during creation of the DDB. If this parameter is NULL, the standard 16 or 20 color system palette will be used.

Returns

Returns the handle of the generated DIB, or NULL if unsuccessful. (NULL return values generally occur only when the system does not have enough memory to complete the operation.) The DIB handle must be released by the application using GlobalFree.