Location size
0000h 2 'bm' file identification
0002H 4 file size
0006H 4 reserved = 0
000ah 4 Offset from the file to the bitmap data
000EH 4 bitmap information header, used to describe the color, compression method, etc. of the bitmap.
0012H 4 bitmap width, in pixels
0016H 4 bitmap height, in pixels
001ah 2 bitmap number = 1
001CH 2 digits of each pixel 1/2/4/8/16/24/32
001EH 4 Compression Description 0 Does Compression / 1 Use 8-bit RLE compression / 2 to store 4-bit RLE compression / 3-bit domain
0022H 4 The size of bitmap data represented by byte number. This number must be a multiple of 4
0026H 4 horizontal resolution expressed by pixels / m
002ah 4 vertical resolution expressed by pixels / m
002EH 4 bitmap uses the number of colors.
0032H 4 Specifies the number of important colors. When the value of this domain is equal to the number of colors (or 0), it means that all colors are as important.
N * 4 palette RGB0
- Bittrack
BI_RLE8: Each pixel is 8-bit RLE compression encoding, which can be compressed using any of an encoding method and an absolute manner, which can be used anywhere in the same figure.
Encoding method: consists of 2 bytes, the first byte specifies the number of pixels used to use the same color, the second byte specifies the color index used. In addition, the first byte in this byte pair can be set to 0, and the value of the second byte is represented:
The value of the second byte is 0: the end of the line.
The value of the second byte is 1: the image ends.
The value of the second byte is 2: The following two bytes indicate the offset of the next pixel from the current horizontal and vertical position.
Absolute mode: The first byte is set to 0, and the second byte is set to a value between 0x03 to 0xFF. In this way, the second byte represents the number of bytes behind this byte, each byte, contains a color index of a single pixel. The compressed data format requires the word boundary alignment.
BI_RLE4: Each pixel is 4-bit RLE compression encoding, and it is also possible to compress any of the encoding mode and absolute mode, which can also be used anywhere in the same figure. These two ways are:
Encoding method: consists of 2 bytes, the first byte specifies the number of pixels, the second byte contains two color indexes, one at a high 4 bits, the other at a low 4 digits. The first pixel uses a high 4-bit color index, the second uses a low 4-bit color index, and the third use high 4-bit color index, according to this class.
Absolute way: The first byte of this byte pair is set to 0, the second byte contains a color index number, and its subsequent byte contains a color index, the color index is stored in this byte, low 4 Bit, a color index corresponds to a pixel. In addition, Bi_RLE4 is also combined with the value in the second byte:
The value of the second byte is 0: the end of the line.
The value of the second byte is 1: the image ends.
The value of the second byte is 2: The following two bytes indicate the offset of the next pixel from the current horizontal and vertical position.