BITMAPFILEHEADER和BITMAPCOREHEADER区分

60 篇文章 5 订阅
54 篇文章 1 订阅

在OS/2样式的DIB内,BITMAPFILEHEADER结构后紧跟了BITMAPCOREHEADER结构,它提供了关于DIB图像的基本信息。

typedef struct tagBITMAPCOREHEADER  // bmch   
{
          DWORD        bcSize ;              // size of the structure = 12
          WORD          bcWidth ;            // width of image in pixels
          WORD          bcHeight ;          // height of image in pixels
          WORD          bcPlanes ;            // = 1
          WORD          bcBitCount ;          // bits per pixel (1, 4, 8, or 24)
}
BITMAPCOREHEADER, * PBITMAPCOREHEADER ;

typedef struct tagBITMAPINFOHEADER  // bmih       
{       
          DWORD biSize ;              // size of the structure = 40       
          LONG  biWidth ;            // width of the image in pixels       
          LONG  biHeight ;            // height of the image in pixels       
          WORD  biPlanes ;            // = 1       
          WORD  biBitCount ;          // bits per pixel (1, 4, 8, 16, 24, or 32)     
          DWORD biCompression ;      // compression code 
          DWORD biSizeImage ;        // number of bytes in image 
          LONG  biXPelsPerMeter ;    // horizontal resolution 
          LONG  biYPelsPerMeter ;    // vertical resolution
          DWORD biClrUsed ;          // number of colors used
          DWORD biClrImportant ;      // number of important colors

BITMAPINFOHEADER, * PBITMAPINFOHEADER ;
您可以通过检查结构的第一字段区分与OS/2兼容的DIB和Windows DIB,前者为12,后者为40。
就是说这两个结构1个是os/2的,1个是windows用的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值