Jump to content

BITMAPINFO

From EDM2

Bit-map information structure.

Each bit plane logically contains (cx * cy * cBitCount) bits, although the actual length can be greater because of padding.

See also BITMAPINFO2, which is preferred.

Fields

cbFix (ULONG)
Length of fixed portion of structure.
This length can be determined using sizeof(BITMAPINFOHEADER).
cx (USHORT)
Bitmap width in pels.
cy (USHORT)
Bitmap height in pels.
cPlanes (USHORT)
Number of bit planes.
cBitCount (USHORT)
Number of bits per pel within a plane.
argbColor[1] (RGB)
Array of RGB values.
This is a packed array of 24-bit RGB values. If there are N bits per pel (N = cPlanes * cBitCount), the array contains 2**N RGB values. However, if N = 24, the bit map does not need the color array because the standard-format bit map, with 24 bits per pel, is assumed to contain RGB values.

Example Code

typedef struct _BITMAPINFO {
 ULONG      cbFix;         /*  Length of fixed portion of structure. */
 USHORT     cx;            /*  Bit-map width in pels. */
 USHORT     cy;            /*  Bit-map height in pels. */
 USHORT     cPlanes;       /*  Number of bit planes. */
 USHORT     cBitCount;     /*  Number of bits per pel within a plane. */
 RGB        argbColor[1];  /*  Array of RGB values. */
} BITMAPINFO;

typedef BITMAPINFO *PBITMAPINFO;