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


Leonardo: The CreateDIB function

Creates a new, empty (either all-black or randomized) DIB of the specified size and color depth. The created DIB consists of a global memory handle containing a BITMAPINFOHEADER, standard color palette, bitmap data for the DIB. Any 8 bit DIBs created with this function will use a 16 color VGA palette.

HDIB API CreateDIB(
UINT Width,
UINT Height,
UINT BitCount,
DWORD Flags);

Width UINT Width of the new DIB in pixels

Height UINT Height of the new DIB in pixels

BitCount UINT Color depth of the new DIB. Possible values:
1 - mono chrome
4 - 16 colors
8 - 256 colors
16 - HighColor (5,5,5)
24 - TrueColor
32 - TrueColor

Flags DWORD CREATEDIB_ZEROINIT - the bits of the DIB are initialized with zeroes (black)
CREATEDIB_NOZERINIT - the bits of the DIB are not initialized and will contain random values

Returns

Returns the handle of the DIB. This handle must be released by the application using GlobalFree.

Remarks

CreateDIB permits no control over the color palette, so CreateCompatibleDIB is generally preferred for use.