Bitmap File Header

The bitmap file header contains information about the type, size, and layout of a device-independent bitmap (DIB) file. In both the Windows 3.0 and Presentation Manager 1.2 DIBs, it is defined as a BITMAPFILEHEADER data structure:

The following code illustrates how to define a bitmap file header.

typedef struct tagBITMAPFILEHEADER {
      USHORT    bfType;
      ULONG     bfSize;
      USHORT    bfReserved1;
      USHORT    bfReserved2;
      ULONG     bfOffBits;
} BITMAPFILEHEADER;

The BITMAPFILEHEADER data structure contains the following fields.