Jump to content

BITMAPINFO: Difference between revisions

From EDM2
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
See also [[BITMAPINFO2]], which is preferred.
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 {
  typedef struct _BITMAPINFO {
   ULONG      cbFix;        /*  Length of fixed portion of structure. */
   ULONG      cbFix;        /*  Length of fixed portion of structure. */
Line 15: Line 26:
   
   
  typedef BITMAPINFO *PBITMAPINFO;
  typedef BITMAPINFO *PBITMAPINFO;
==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 color array because the standard-format bit map, with 24 bits per pel, is assumed to contain RGB values.


[[Category:GPI 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;