BITMAPINFO: Difference between revisions
Appearance
Created page with "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 BITMA..." |
No edit summary |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Bit-map information structure. | Bit-map information structure. | ||
Each bit plane logically contains (cx * cy * cBitCount) bits, although the actual length can be greater because of padding. | 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. | See also [[BITMAPINFO2]], which is preferred. | ||
== | ==Fields== | ||
typedef struct _BITMAPINFO { | ;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. */ | ULONG cbFix; /* Length of fixed portion of structure. */ | ||
USHORT cx; /* Bit-map width in pels. */ | USHORT cx; /* Bit-map width in pels. */ | ||
Line 13: | Line 23: | ||
USHORT cBitCount; /* Number of bits per pel within a plane. */ | USHORT cBitCount; /* Number of bits per pel within a plane. */ | ||
RGB argbColor[1]; /* Array of RGB values. */ | RGB argbColor[1]; /* Array of RGB values. */ | ||
} BITMAPINFO; | } BITMAPINFO; | ||
typedef BITMAPINFO *PBITMAPINFO; | |||
typedef BITMAPINFO *PBITMAPINFO; | |||
[[Category:Data type]] | [[Category:GPI Data type]] |
Latest revision as of 17:31, 2 May 2025
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;