Honour DIB_PAL_COLORS when the bitmap depths match.
This commit is contained in:
parent
605064a4bf
commit
1614517776
|
@ -433,7 +433,14 @@ INT WINAPI GetDIBits(
|
|||
/* 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) {
|
||||
|
|
Loading…
Reference in New Issue