Remarks
For a color bitmap, either the nPlanes or nBitcount parameter should be set to one. If both parameters are set to one, CreateBitmap creates a monochrome bitmap.
Although you cannot directly select a bitmap for a display device, you can select it as the current bitmap for a memory device context by using CDC::SelectObject and copying to any compatible device context by using the CDC::BitBlt function.
BOOL CreateBitmap (
int nWidth,
int nHeight,
UINT nPlanes,
UINT nBitcount,
const void* lpBits );
Parameters
nWidth
Specifies the width, in pixels, of the bitmap.
nHeight
Specifies the height, in pixels, of the bitmap.
nPlanes
Specifies the number of color planes in the bitmap.
nBitcount
Specifies the number of color bits per display pixel.
lpBits
Points to a short-integer array that contains the initial bitmap bit values. If it is NULL, the new bitmap is left uninitialized.
Return Value
Nonzero if it is successful; otherwise, it is zero.