Petr KAREN
January 4th, 2006, 05:19 AM
I tried to setup "pure two-color" bitmap by using two-byte (16bit) pixel size. Particular values of BITMAPFILEHEADER structure are as follows:
biBitCount=16;
biCompression=BI_BITFIELDS;
Then I assigned three DWORD entries (masks) within bmiColors of BITMAPINFO structure for RGB components.
All goes well as long as all masks are non-zero (and non-overlapped, of course). But, my actual motivation was to use just two colors coded within 8bits each. So I set one of mask to zero and two others to 0x00FF and 0xFF00. But with this desired setting CreateDIBitmap or CreateDIBSection functions return NULL HBITMAP in order to inform me that this approach is probably not possible. I would say, it's a pitty...
Do you have some comments and/or advices?
biBitCount=16;
biCompression=BI_BITFIELDS;
Then I assigned three DWORD entries (masks) within bmiColors of BITMAPINFO structure for RGB components.
All goes well as long as all masks are non-zero (and non-overlapped, of course). But, my actual motivation was to use just two colors coded within 8bits each. So I set one of mask to zero and two others to 0x00FF and 0xFF00. But with this desired setting CreateDIBitmap or CreateDIBSection functions return NULL HBITMAP in order to inform me that this approach is probably not possible. I would say, it's a pitty...
Do you have some comments and/or advices?