Herd Software Development
DaVinci Graphics Library
DaVinci Documentation
Creates a DDB (Device Dependent Bitmap, represented by an HBITMAP) from a DIB (Device Independent Bitmap, represented by an HDIB).
HBITMAP FAR PASCAL BitmapFromDIB(
HDIB hDIB
HPALETTE hpal);
hDIB Handle of a source DIB at 1, 4, 8 or 24 bits of color depth.
The handle of the source DIB remains valid after this operation.
hpal Handle of a Windows color palette to be applied when the DIB is generated, such as a palette generated by a call to CreateDibPalette. May be a pre-existing palette of another DIB.
If this parameter is NULL, the standard 16 or 20 color system palette is applied.
DDBs generated by BitmapFromDib may only be used with the color palette applied during the DDB's creation.
Returns the handle of the generated bitmap, or NULL if unsuccessful. (NULL return values generally occur only when the system does not have enough memory to complete the operation.) The bitmap handle must be released by the application using DeleteObject.
SelectPalette.