Help about GetBitmapBits!!!
-
unsigned char *px = new unsigned char[bm.bmHeight*bm.bmWidthBytes]; bitmap->GetBitmapBits(bm.bmHeight*bm.bmWidthBytes,px); Please, tell me the color format of the px above. Thank you,anyway! Hello World!
Won't work. For starters, some formats have extra bytes of padding on the end of each scanline, so your size could be wrong. However, if bmWidthBytes is accurate, then it's easy. bmWidthByte value color format 1 paletised, could be 1, 4 or 8 bit 2 16 bit 3 24 bit 4 32 bit ( but the last 8 are ignored. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
Won't work. For starters, some formats have extra bytes of padding on the end of each scanline, so your size could be wrong. However, if bmWidthBytes is accurate, then it's easy. bmWidthByte value color format 1 paletised, could be 1, 4 or 8 bit 2 16 bit 3 24 bit 4 32 bit ( but the last 8 are ignored. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
unsigned char *px = new unsigned char[bm.bmHeight*bm.bmWidthBytes]; bitmap->GetBitmapBits(bm.bmHeight*bm.bmWidthBytes,px); i found px[2] is a red color BYTE. whereas px[0] and px[1] is what color BYTE. Thank you! Hello World!
Windows generally stores 24 and 32 bit images as BGR, rather than RGB. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
Windows generally stores 24 and 32 bit images as BGR, rather than RGB. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
-
unsigned char *px = new unsigned char[bm.bmHeight*bm.bmWidthBytes]; bitmap->GetBitmapBits(bm.bmHeight*bm.bmWidthBytes,px); if my image is 24 bit, the px array is stored as neither BGR nor RGB. why so? Thank you! Hello World!
The only possible reaon I can think of is my first hunch - GetBitmapBits does not work. Actually, I think it does, only if your bitmap is a DIBSection. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder