bmp图片格式

总共54字节

/**
 * bmp文件信息
 */
#pragma pack(1)
    typedef struct
    {
        char type[2];             // 文件类型
        unsigned int size;        // 文件大小
        unsigned short reserved1; // 保留, 必须为零
        unsigned short reserved2; // 保留, 必须为零
        unsigned int offset;      // 从头到位图数据的偏移
    } FileInfo;
#pragma pack()

/**
 * 位图信息
 */
#pragma pack(1)
    typedef struct
    {
        unsigned int size;        // 本结构体所占用字节数, 即40个字节
        int width;                // 位图的宽度, 以像素为单位, 像素数量是4字节对齐的
        int height;               // 位图的高度, 以像素为单位
        unsigned short planes;    // 目标设备的级别, 必须为1
        unsigned short count;     // 每个像素所需的位数, 必须是 1(双色), 4(16色), 8(256色)或24(真彩色) 之一
        unsigned int compression; // 位图压缩类型, 必须是 0(不压缩), 1(BI_RLE8压缩类型)或2(BI_RLE4压缩类型) 之一
        unsigned int sizeimage;   // 位图的大小, 以字节为单位
        unsigned int xmeter;      // 位图水平分辨率, 每米像素数
        unsigned int ymeter;      // 位图垂直分辨率, 每米像素数
        unsigned int cused;       // 位图实际使用的颜色表中的颜色数
        unsigned int cimportant;  // 位图显示过程中重要的颜色数
    } BitMapInfo;
#pragma pack()
posted @   thomas_blog  阅读(34)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示