Windows BMP files begin with a 54-byte header:
offset size description
0 2 signature, must be 4D42 hex
2 4 size of BMP file in bytes (unreliable)
6 2 reserved, must be zero
8 2 reserved, must be zero
10 4 offset to start of image data in bytes
14 4 size of BITMAPINFOHEADER structure, must be 40
18 4 image width in pixels
22 4 image height in pixels
26 2 number of planes in the image, must be 1
28 2 number of bits per pixel (1, 4, 8, or 24)
30 4 compression type (0=none, 1=RLE-8, 2=RLE-4)
34 4 size of image data in bytes (including padding)
38 4 horizontal resolution in pixels per meter (unreliable)
42 4 vertical resolution in pixels per meter (unreliable)
46 4 number of colors in image, or zero
50 4 number of important colors, or zero
typedef struct BMPHADER {
BYTE Identy[2];
BYTE FileSize[4];
BYTE Reserved[4];
BYTE DataOffset[4];
BYTE HeaderSize[4];
BYTE Width[4];
BYTE Height[4];
BYTE Planes[2];
BYTE BitsPerPixel[2];
BYTE Compression[4];
BYTE DataSize[4];
BYTE Horizontal[4];
BYTE Vertical[4];
BYTE Colors[4];
BYTE Important[4];
};
Offset Field Size
0000h Identifier 2 bytes
0002h File Size 1 dword
0006h Reserved 1 dword
000Ah Bitmap Data Offset 1 dword
000Eh Bitmap Header Size 1 dword
0012h Width 1 dword
0016h Height 1 dword
001Ah Planes 1 word
001Ch Bits Per Pixel 1 word
001Eh Compression 1 dword
0022h Bitmap Data Size 1 dword
0026h HResolution 1 dword
002Ah VResolution 1 dword
002Eh Colors 1 dword
0032h Important Colors 1 dword
0036h Palette N * 4 byte
0436h Bitmap Data x bytes
offset size description
0 2 signature, must be 4D42 hex
2 4 size of BMP file in bytes (unreliable)
6 2 reserved, must be zero
8 2 reserved, must be zero
10 4 offset to start of image data in bytes
14 4 size of BITMAPINFOHEADER structure, must be 40
18 4 image width in pixels
22 4 image height in pixels
26 2 number of planes in the image, must be 1
28 2 number of bits per pixel (1, 4, 8, or 24)
30 4 compression type (0=none, 1=RLE-8, 2=RLE-4)
34 4 size of image data in bytes (including padding)
38 4 horizontal resolution in pixels per meter (unreliable)
42 4 vertical resolution in pixels per meter (unreliable)
46 4 number of colors in image, or zero
50 4 number of important colors, or zero
typedef struct BMPHADER {
BYTE Identy[2];
BYTE FileSize[4];
BYTE Reserved[4];
BYTE DataOffset[4];
BYTE HeaderSize[4];
BYTE Width[4];
BYTE Height[4];
BYTE Planes[2];
BYTE BitsPerPixel[2];
BYTE Compression[4];
BYTE DataSize[4];
BYTE Horizontal[4];
BYTE Vertical[4];
BYTE Colors[4];
BYTE Important[4];
};
Offset Field Size
0000h Identifier 2 bytes
0002h File Size 1 dword
0006h Reserved 1 dword
000Ah Bitmap Data Offset 1 dword
000Eh Bitmap Header Size 1 dword
0012h Width 1 dword
0016h Height 1 dword
001Ah Planes 1 word
001Ch Bits Per Pixel 1 word
001Eh Compression 1 dword
0022h Bitmap Data Size 1 dword
0026h HResolution 1 dword
002Ah VResolution 1 dword
002Eh Colors 1 dword
0032h Important Colors 1 dword
0036h Palette N * 4 byte
0436h Bitmap Data x bytes
'Education' 카테고리의 다른 글
| Embedded System - Linux (0) | 2009/06/08 |
|---|---|
| Vim editor 사용팁 (0) | 2009/04/15 |
| Windows BMP files begin with a 54-byte header (0) | 2009/02/13 |
| [linux] KDE 시작하기 (KPersonalizer) (0) | 2008/09/30 |
| [linux] 젠투에서 중요한 설정파일들 (0) | 2008/09/30 |
| [linux] Install Gentoo Linux - KDE Desktop 환경 구성 (0) | 2008/09/30 |