Locating the Color Table

An application can use the biSize (bcSize) field of the BITMAPINFOHEADER (BITMAPCOREHEADER) structure to locate the color table. Each of the following statements assigns the pColor variable the byte offset of the color table from the beginning of the file:

/* Windows 3.0 DIB              */
pColor = (LPSTR)pBitmapInfo + (USHORT)pBitmapInfo->biSize
/* Presentation Manager 1.2 DIB */
pColor = (LPSTR)pBitmapCoreInfo + (USHORT)pBitmapCoreInfo->bcSize


[Back: Field Descriptions]
[Next: Interpreting the Color Table]