1. The BMP file consists of a BMP file consisting of file headers, bitmap information heads, color information, and graphics data. 2. The BMP file head BMP file header data contains information such as the type, file size and bitmap start positions of the BMP file. Its structure is defined as follows: typedef struct tagbitmapfilehead {WordBfType; // bitmap file type, must be the size of BMDword bfsize; // bitmap file, in bytes, Wordbfreserved1; // bitmap file reserved word, must be 0wordbfreserved2 ; // bitmap file reserved word, must be the starting position of 0Dword bfofbits; // bitmap data, in byte as a bitmapfileHeader; 3. Bit Figure information head BMP bitmap information header data is used to explain the size of the bitmap. Typedef struct tagbitmapinfoheader {dWord bisize; // This structure occupies the number of bytes longbiWidth; // bit map, in pixels, longbiheight; // bitmap height, in pixels Word biplanes; // target device Level, the number of bits required for 1Word Bibitcount // each pixel must be 1 (two-color), // 4 (16 colors), 8 (256 colors) or 24 (true color) DWORD BICOMPIEN The bitmap compression type must be 0 (no compression), // 1 (bi_rle8 compression type) or 2 (Bi_RLE4 compression type) DWORD BisizeImage; // bitmap size, in bytes, LONGBIXPELSPERSPERSPELSPERSPERSPERSPELSPERSPERSPELSPERSPERSPELSPERMELSPERSPELSPERSPERSPELSPERMELSPERSPELSPERMELSPERSPELSPERGETER; // Figure horizontal resolution, pixel number of pixels per rice, // bit map vertical resolution, the number of pixels DWORD BICLRUSED; // Bitgram actually used color table DWord biclrimportant; // Bitmap display process Color number} BitmapInfoHeader; 4. Color table color meter is used to explain the color in the bitmap, which has several entries, each entry is a RGBQUAD type structure, defining a color. The RGBQUAD structure is defined as follows: typedef struct tagrgbquad {bytergbblue; // Blue brightness (value range is 0-255) BytergBGreen; // Green brightness (value range is 0-255) Bytergbred; // Red brightness (value) Range 0-255) BytergBreserved; // Reserved, must be 0} RGBQUAD; the number of RGBQUAD structure data in color table has bibitcount to determine: 2, 16,256 entries, respectively, 2, 16,256 items, respectively, respectively When BiBitCount = 24, there is no color entry. The bitmap information head and color table form bitmap information, the BitmapInfo structure is defined as follows: typedef struct tagbitmapinfo {bitmapinfoheader bmiheader; // bitmap information head RGBQUAD BICILORS [1]; // color table} BitmapInfo; 5. Bitmap data bitmap The data records each pixel value of the bitmap, the recording order is from left to right, and the scan line is from bottom to top.