HBITMAP CreateBitmapIndirect(lpbm) | |||||
LPBITMAP lpbm; | /* address of the bitmap data | */ |
The CreateBitmapIndirect function creates a bitmap with the given width, height, and color format (color planes and bits per pixel).
lpbm
Points to a BITMAP structure that contains information about the bitmap. The BITMAP structure has the following form:
typedef struct tagBITMAP { /* bm */
LONG bmType;
LONG bmWidth;
LONG bmHeight;
LONG bmWidthBytes;
WORD bmPlanes;
WORD bmBitsPixel;
LPVOID bmBits;
} BITMAP;
The return value identifies a bitmap if the function is successful. Otherwise, it is NULL.
The CreateBitmapIndirect function should only be used to create monochrome bitmaps. The CreateDIBitmap function should be used to create color bitmaps. If the bitmap is monochrome, 0's represent the foreground color and 1's represent the background color for the destination device context.
Once a bitmap is created, it can be selected into a device context by calling the SelectObject function.
BitBlt, CreateBitmap, CreateDIBitmap, SelectObject