RGB (for Christian)
-
Christian, does this code correct for 8 bpp Bitmap? WidthBytes=lpBitmap->biWidth/4; if (lpBitmap->biWidth%4) WidthBytes++; WidthBytes*=4; How to use color table for 8bpp bitmap (for pixels)? I think, RGBQUAD Quad = (LPRGBQUAD) Data; in this case (for 8bpp) doesn't work Am i ridht?
-
Christian, does this code correct for 8 bpp Bitmap? WidthBytes=lpBitmap->biWidth/4; if (lpBitmap->biWidth%4) WidthBytes++; WidthBytes*=4; How to use color table for 8bpp bitmap (for pixels)? I think, RGBQUAD Quad = (LPRGBQUAD) Data; in this case (for 8bpp) doesn't work Am i ridht?
That looks promising. You'd need to then load the palette and look up the colour values based on the indexes. You're right, RGBQUAD will not work for 8/16 bit. To be honest, if it was me, I'd do it the lazy way and convert to a 24 bit DIBSection and then just read the bits off that in memory. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
-
That looks promising. You'd need to then load the palette and look up the colour values based on the indexes. You're right, RGBQUAD will not work for 8/16 bit. To be honest, if it was me, I'd do it the lazy way and convert to a 24 bit DIBSection and then just read the bits off that in memory. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
-
Chris has a nice DIBSection wrapper on this site, you just create a 24 bit DIBSection and select it into a DC, then you can copy it across, and the DIBSection has a pointer to the data. LMK if you have any trouble, I'll dig it up and write some code for you. You probably don't even need the wrapper, if you go to www.wdj.com, they have an article online of mine from September, the code from which will show you how to create a DIBSection yourself and copy a bitmap onto it and access the bits directly. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
-
Chris has a nice DIBSection wrapper on this site, you just create a 24 bit DIBSection and select it into a DC, then you can copy it across, and the DIBSection has a pointer to the data. LMK if you have any trouble, I'll dig it up and write some code for you. You probably don't even need the wrapper, if you go to www.wdj.com, they have an article online of mine from September, the code from which will show you how to create a DIBSection yourself and copy a bitmap onto it and access the bits directly. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001