文件IO-BMP格式结构体
<p>位图文件头</p><pre><code>typedef struct tagBITMAP_FILE_HEADER
{
short bfType;//文件标识
int bfSize;//文件大小
short bfReserved1;//保留字
short bfReserved2;//保留字
int bfOffBits;//文件指示器偏移量相较于文件开头
} bpFile_Header, *PbpFile_Header;
</code></pre>
<p>位图信息头</p>
<pre><code>typedef struct tagBITMAPINFOHEADER
{
int bpSize;//图像描述信息块的大小
int bpWidth;//图像宽度
int bpHeight;//图像高度
short bpPlanes;//图像的plane总数(恒为1)
short bpBitCount;//记录颜色的位数取值1(双色),4,6,24,32
int bpCompression;//数据压缩方式(0:不压缩;1:8位压缩;2:4位压缩)
int bpSizeImage;//图像区数据的大小,必须是4的倍数
int bpXPelsPerMeter;//水平每米有多少像素,在设备无关位图中,填写00H
int bpYPelsPerMeter;//垂直每米有多少像素,在设备无关位图中,填写00H
int bpClrUsed;// 此图像所有的颜色数,不用,固定为0
int bpClrImportant;// 重要颜色数,不用,固定为0
} bpInfo_Header, *PbpInfo_Header;
</code></pre>
<p>调色板信息</p>
<pre><code>// 调色板信息结构体
typedef struct tag_bitmap_palette
{
unsigned char blue;
unsigned char green;
unsigned char red;
unsigned char reserved;
}Bitmap_Palette;
</code></pre>
<p>存储格式:<mark>小端存储</mark></p><br><br>
来源:https://www.cnblogs.com/lradian/p/18831411
頁:
[1]