师悠逸 发表于 2025-5-29 13:48:17

文件IO-BMP格式结构体

位图文件头
typedef struct tagBITMAP_FILE_HEADER
{
      short      bfType;//文件标识
      int          bfSize;//文件大小
      short      bfReserved1;//保留字
      short      bfReserved2;//保留字
      int          bfOffBits;//文件指示器偏移量相较于文件开头
} bpFile_Header, *PbpFile_Header;位图信息头
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;调色板信息
// 调色板信息结构体
typedef struct tag_bitmap_palette
{
    unsigned char blue;
    unsigned char green;
    unsigned char red;
    unsigned char reserved;
}Bitmap_Palette;存储格式:小端存储

来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页: [1]
查看完整版本: 文件IO-BMP格式结构体