Interpreting the Color Table
The biSize (bcSize) field of the BITMAPINFOHEADER (BITMAPCOREHEADER)
structure specifies how many bits define each pixel and specifies the maximum
number of colors in the bitmap. Its value affects your interpretation of
the color table.
The biSize (bcSize) field can have any of the following values:
Value
1
The bitmap is monochrome, and the color table contains
two entries. Each bit in the bitmap array represents a pixel. If the bit
is clear, the pixel is displayed with the color of the first entry in the
color table. If the bit is set, the pixel has the color of the second entry
in the table.
4
The bitmap
has a maximum of 16 colors. Each pixel in the bitmap is represented by a
4-bit index into the color table. For example, if the first byte in the
bitmap is 0x1F, then the byte represents 2 pixels. The first pixel contains
the color in the second table entry, and the second pixel contains the color
in the 16th table entry.
8
The
bitmap has a maximum of 256 colors. Each pixel in the bitmap is represented
by a byte-sized index into the color table. For example, if the first byte
in the bitmap is 0x1F, then the first pixel has the color of the thirty-second
table entry.
24
The bitmap
has a maximum of 224 colors. The bmiColors (bmciColors) field
is NULL, and each three bytes in the bitmap array represent the relative
intensities of red, green, and blue, respectively, of a pixel.
Note on Windows DIBs For Windows 3.0 DIBs, the field of the BITMAPINFOHEADER
structure specifies the number of color indexes in the color table actually
used by the bitmap. If the biClrUsed field is set to 0, the bit map
uses the maximum number of colors corresponding to the value of the field.
[Back: Locating the Color Table]
[Next: Bitmap Data]