Bitmap Example

To make the ordering of all the bytes clear, consider this simple example of a 5-by-3 array of colored pels:

Red   Green Blue  Red   Green
Blue  Red   Green Blue  Red
Green Blue  Red   Green Blue

ULONG ExampleBitmap[]  {
    0x23,0x12,0x30,0x00                 /* bottom line */
    0x31,0x23,0x10,0x00                 /* middle line */
    0x12,0x31,0x20,0x00                 /* top line    */
};

#define BLACK  0x00000000L
#define RED    0x00FF0000L
#define GREEN  0x0000FF00L
#define BLUE   0x000000FFL

struct BitmapInfoTable ExampleInfo = {
       5,                               /* width       */
       3,                               /* height      */
       1,                               /* planes      */
       4,                               /* bitcount    */
       BLACK,RED,GREEN,BLUE,            /* color table */
       BLACK,BLACK,BLACK,BLACK,
       BLACK,BLACK,BLACK,BLACK,
       BLACK,BLACK,BLACK,BLACK
};


[Back: Bitmap Information Tables]
[Next: Bitmap File Format]