BITMAPINFOHEADER结构有关问题
BITMAPINFOHEADER结构问题?
BITMAPINFOHEADER中的biBitCount指定表示颜色时要用到的位数,biClrUsed
指定本图象实际用到的颜色数,如果该值为零,则用到的颜色数为2^biBitCount,
问题来了,为什么一张图,是16色,biBitCount=4,而biClrUsed也等于4,而不是0呢?
而且用StretchDIBits API显示会有问题呢?
------解决方案--------------------
biClrUsed是压缩时使用的,如果是biCompression=BI_RGB,这个值会被忽略掉。
------解决方案--------------------
If biClrUsed is nonzero and the biBitCount member is less than 16, the biClrUsed member specifies the actual number of colors the graphics engine or device driver accesses. \
估计你的颜色表只有4项吧, 多余的颜色不需要了. 不看到图片是无法知道的
BITMAPINFOHEADER中的biBitCount指定表示颜色时要用到的位数,biClrUsed
指定本图象实际用到的颜色数,如果该值为零,则用到的颜色数为2^biBitCount,
问题来了,为什么一张图,是16色,biBitCount=4,而biClrUsed也等于4,而不是0呢?
而且用StretchDIBits API显示会有问题呢?
------解决方案--------------------
biClrUsed是压缩时使用的,如果是biCompression=BI_RGB,这个值会被忽略掉。
------解决方案--------------------
If biClrUsed is nonzero and the biBitCount member is less than 16, the biClrUsed member specifies the actual number of colors the graphics engine or device driver accesses. \
估计你的颜色表只有4项吧, 多余的颜色不需要了. 不看到图片是无法知道的