谁能帮我翻译下(或者找到译文)关于位图的一篇文章

来源:百度知道 编辑:UC知道 时间:2024/06/17 17:36:28
this document describes the microsoft windows and ibm os/2 picture bitmap
files, called bitmaps or bmp files. most of the descriptions of the bmp
file concentrate on the microsoft windows bmp structures like
bmpinfoheader and bmpcoreinfo , but only a few describe the file contents
on byte level. this information is therefor only intended to be used in
applications where direct reading and writing of a bmp file is required.
bitmap file format
the following chapters contain the detailed information on the contents of
the bmp file. first more general information will be given regarding the
byte order and file alignment. the second chapter will concentrate on the
byte-level contents of a bmp file. the third chapter will elaborate on
this chapter and explain some of the concepts - like compression - and/or
values in detail.
general

---- 一、BMP文件结构

---- 1. BMP文件组成

---- BMP文件由文件头、位图信息头、颜色信息和图形数据四部分组成。

---- 2. BMP文件头

---- BMP文件头数据结构含有BMP文件的类型、文件大小和位图起始位置等信息。

---- 其结构定义如下:

typedef struct tagBITMAPFILEHEADER
{
WORDbfType; // 位图文件的类型,必须为BM
DWORD bfSize; // 位图文件的大小,以字节为单位
WORDbfReserved1; // 位图文件保留字,必须为0
WORDbfReserved2; // 位图文件保留字,必须为0
DWORD bfOffBits; // 位图数据的起始位置,以相对于位图
// 文件头的偏移量表示,以字节为单位
} BITMAPFILEHEADER;

---- 3. 位图信息头

BMP位图信息头数据用于说明位图的尺寸等信息。
typedef struct tagBITMAPINFOHEADER{
DWORD biSize; // 本结构所占用字节数
LONGbiWidth; // 位图的宽度,以像素为单位
LONGbiHeight; // 位图的高度,以像素为单位
WORD biPlanes; // 目标设备的级别,必须为1
WORD biBitCount// 每个像素所需的位数,必须是1(双色),
// 4(16色),8(256色)或24(真彩色)之一
DWORD biCompression; // 位图压缩类型,必须是 0(不压缩),
// 1(BI_RLE8压缩类型)或2(BI_RLE4压缩类型)之一
DWORD biSizeImage; // 位图的大小,以字节为单位
LONGbiX