Commit d7a9d4bd authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

CreateDIBSection ignores the supplied values of biClrUsed and

biClrImportant and calculates them from biBitCount.
parent 4c7b65db
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment