C bitmapfileheader-如何读取位?
我的问题是如何在BITMAPFILEHEADER中组织位 我有下面的图片 如果我查看图像的标题,我会得到以下位序列C bitmapfileheader-如何读取位?,c,image,bitmap,endianness,bmp,C,Image,Bitmap,Endianness,Bmp,我的问题是如何在BITMAPFILEHEADER中组织位 我有下面的图片 如果我查看图像的标题,我会得到以下位序列 424df6 000000 000000 003600 0000 (2 bytes) 42 4d bftype - (BM) as expected. (4 bytes) f6 00 00 00 bfsize - the size is 246 bytes. (2 bytes) 00 00 bfReserved1 - must be 0. (2 bytes) 00 00 bfR
424df6 000000 000000 003600 0000
(2 bytes) 42 4d bftype - (BM) as expected.
(4 bytes) f6 00 00 00 bfsize - the size is 246 bytes.
(2 bytes) 00 00 bfReserved1 - must be 0.
(2 bytes) 00 00 bfReserved2 - must be 0.
(4 bytes) 36 00 00 00 bfOffBits - should be 56.
我的问题是如何读取这些位?如果bfsize是DWORD(32位-4字节),那么246不应该表示为00F6吗?同样的道理也适用于bOffBits。阅读。@JoachimPileborg以2秒的优势击败了我;)此外,如果您只为标题创建(或使用现有)结构,并将该结构作为单个实体读取,则会简单得多。谢谢。现在就开始吧。@JoachimPileborg应该是答案。