DDB and device-related dot matrix DIB and device-independent dot matrix map. GIF compresses the .jpeg format
.Dib file format Since OS / 2 (1.1 version), then in Windows 3.0 uses OS / 2 dot matrix map format. He is called DIB. The program can subtract the DIB file to the first 14 position groups into continuous memory this time, called the Packed Dib format.
DIB mainly consists of four parts, information head, RGB color control table (not necessarily), dot matrix graphic (data) Packed Dib No file header information file header structure BitmapFileHeadertypef struct tagbitmapfileHeader {Word bftype; // Bitmap file must be the size of the BM DWORD BFSIZE; // Bitmap file, in bytes Word bFReServed1; // bitmap file reserved word, must be 0 word bFReServed2; // bitmap file Word, must be 0 dword bfoffbits; // bitmap data of the starting position, with respect to the offset of the bitmap // file header} BitmapfileHeader; Word accounts for two bytes, DWORD Four bytes, then BitmapFileHeader is 14 bytes
0000-0001: File logo, for the letter ASCII code "BM". 0002-0005: File size. 0006-0009: Reserved, each byte is filled in "00". 000A-000d: Record the starting position of the image data area. The information of each byte means: the size of the file header information block, the size of the image description information block, the size of the image color table, and is reserved (to 01).
In the header structure BITMAPFILEHEADER structure OS / 2 followed BITMAPCOREHEADER structure configuration windows in BITMAPFILEHEADER followed BITMAPINFOHEADER structure and BITMAPINFOHEADER BITMAPCOREHEADER nature is the same, but the different structures of the operating system is different typedef struct tagBITMAPINFOHEADER {DWORD biSize; / / This structure takes up the number of bytes long biwidth; // bit map, the height of the pixels long biheight; // bitmap, the level of pixels Word Biplanes; // Target device must be 1 word BIBITCOUNT; / / The number of digits required for each pixel must be 1 (two-color), // 4 (16 colors), 8 (256 colors) or 24 (true color) DWORD BICOMPIRESSION; // bitmap compression type Must be 0 (non-compressed), // 1 (bi_rle8 compression type) or 2 (Bi_RLE4 compression type) DWORD BisizeImage; // bitmap size, in bytes, line Bixpelspermeter; // bitmap level resolution Rate, the number of pixels per mowl long biypelspermeter; // bit map vertical resolution, the number of pixels DWord biclrused; // // Dominant color table in the color table in the color table DWord biclrimportant; // Bitmap display During important color Number} BitMapInfoHeader; 000E-0011: The size of the image describes the information block, which is often 28h. 0012-0015: Image width. 0016-0019: Image height. 001a-001b: The total number of plane (constant 1). 001c-001d: Recording the number of pixels, very important values, and the number of images of the image is determined by this value. 001e-0021: Data compression mode (numeric position 0: no compression; 1: 8 bits compression; 2: 4 bits). 0022-0025: The size of the image area data. 0026-0029: How much pixels per meter per meter are not included in the device. 002A-002D: How many pixels per meter per meter are permatched in the device, and each byte is filled in 00H. 002e-0031: The number of colors used in this image, such as 0, indicating that all colors is as important. This article is an online resource individual summary