Microsoft Documentation
The BITMAP
structure contains information about a bitmap (a device-independent bitmap or DIB).
typedef struct tagBITMAP {
LONG bmType;
LONG bmWidth;
LONG bmHeight;
LONG bmWidthBytes;
WORD bmPlanes;
WORD bmBitsPixel;
LPVOID bmBits;
} BITMAP, *PBITMAP, NEAR *NPBITMAP, FAR *LPBITMAP;
Member | Description |
---|---|
bmType |
Specifies the bitmap type. This member must be zero. |
bmWidth |
Specifies the width of the bitmap, in pixels. |
bmHeight |
Specifies the height of the bitmap, in pixels. |
bmWidthBytes |
Specifies the width of the bitmap, in bytes. This value must be a multiple of 4. |
bmPlanes |
Specifies the number of color planes in the bitmap. This value must be 1. |
bmBitsPixel |
Specifies the number of bits per pixel. |
bmBits |
Pointer to the bitmap memory. If this member is NULL, the memory for the bitmap is allocated as part of the structure. |
The BITMAP
structure is used by the following GDI functions:
CreateBitmap
CreateBitmapIndirect
GetBitmapBits
SetBitmapBits
The bmWidthBytes
member specifies the number of bytes in each raster scanline. A scanline is a horizontal row of pixels. The value of bmWidthBytes
must be a multiple of 4.
The bmPlanes
member specifies the number of color planes. For device-independent bitmaps (DIBs), this value is 1. For device-dependent bitmaps, it can be more than 1.
The bmBitsPixel
member specifies the number of color bits used to represent each pixel. For DIBs, this value can be 1, 4, 8, 16, 24, or 32. For device-dependent bitmaps, it can also be 1, 4, 8, 16, 24, or 32.
The bmBits
member is a pointer to the actual bitmap data. This data is an array of bytes that defines the bitmap pixels.
Header: Wingdi.h
Library: Gdi32.lib