dibs: GetDIBits DIB_PAL_COLORS fix
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Fri Mar 26 06:33:50 CST 2004
Huw Davies <huw at codeweavers.com>
Honour DIB_PAL_COLORS when the bitmap depths match.
--
Huw Davies
huw at codeweavers.com
--- objects/dib.c 2004-03-26 12:27:45.000000000 +0000
+++ objects/dib.c 2004-03-26 12:28:00.000000000 +0000
@@ -433,7 +433,14 @@
/* If the bitmap object already has a dib section at the
same color depth then get the color map from it */
if (bmp->dib && bmp->dib->dsBm.bmBitsPixel == info->bmiHeader.biBitCount) {
- GetDIBColorTable(hdc, 0, 1 << info->bmiHeader.biBitCount, info->bmiColors);
+ if(coloruse == DIB_RGB_COLORS)
+ GetDIBColorTable(hdc, 0, 1 << info->bmiHeader.biBitCount, info->bmiColors);
+ else {
+ WORD *index = (WORD*)info->bmiColors;
+ int i;
+ for(i = 0; i < 1 << info->bmiHeader.biBitCount; i++, index++)
+ *index = i;
+ }
}
else {
if(info->bmiHeader.biBitCount >= bmp->bitmap.bmBitsPixel) {
More information about the wine-patches
mailing list