CreateDIBSection ignores the supplied values of biClrUsed and

biClrImportant and calculates them from biBitCount.
This commit is contained in:
Huw Davies 2003-11-11 00:27:10 +00:00 committed by Alexandre Julliard
parent 4c7b65db8c
commit d7a9d4bd2e

View File

@ -897,6 +897,12 @@ HBITMAP DIB_CreateDIBSection(HDC hdc, BITMAPINFO *bmi, UINT usage,
bDesktopDC = TRUE;
}
/* Windows ignores the supplied values of biClrUsed and biClrImportant thus: */
if (bmi->bmiHeader.biBitCount >= 1 && bmi->bmiHeader.biBitCount <= 8)
bmi->bmiHeader.biClrUsed = bmi->bmiHeader.biClrImportant = 1L << bmi->bmiHeader.biBitCount;
else
bmi->bmiHeader.biClrUsed = bmi->bmiHeader.biClrImportant = 0;
if ((dc = DC_GetDCPtr( hdc )))
{
hbitmap = dc->funcs->pCreateDIBSection(dc->physDev, bmi, usage, bits, section, offset, ovr_pitch);