请看charles petzold的一段话 Probably the most common DIBs you'll find will have a bit count of 8. The 8-bit DIBs will fall into two categories: gray-shade DIBs and palletized color DIBs. Unfortunately, nothing in the header indicates what type of 8-bit DIB you're dealing with. 请看我的翻译 经常碰到的就数8位的图像了(注:现在不成立了)。8位图像有两种格式:灰度图像和调色板图像。 不幸的是,文件的标题信息中没有标明属于哪一种图像。 请注意最后一句话,标题信息中没有标明,也就是说,没有办法直接得到了。 我不明白,搂主什么时候需要这种东西,请赐教!
对一个灰度的图像,每个点由从 0 (黑色)到 255 (白色)的亮度值来表现,其中间的值来表现不同程度的灰。
一个灰度图像和一个 RGB 图像最本质的区别就是它们“颜色通道”的数量:一个灰度图像只有一个;一个 RGB 图像有三个。一个 RGB 图像可以认为是三个灰度图像的叠加,一个为红色,一个为绿色,另一个为蓝色。
先看bitinfoheader 的bitcount,《=8,然后看看他的RGBQUAD,如果r,g,b的直都相等就是了,~~~~
Probably the most common DIBs you'll find will have a bit count of 8. The 8-bit DIBs will fall into two categories: gray-shade DIBs and palletized color DIBs. Unfortunately, nothing in the header indicates what type of 8-bit DIB you're dealing with.
请看我的翻译
经常碰到的就数8位的图像了(注:现在不成立了)。8位图像有两种格式:灰度图像和调色板图像。
不幸的是,文件的标题信息中没有标明属于哪一种图像。
请注意最后一句话,标题信息中没有标明,也就是说,没有办法直接得到了。
我不明白,搂主什么时候需要这种东西,请赐教!