Module: wine Branch: master Commit: 129f48a69224c7fa7d46577483a7351ceb5b0a99 URL: http://source.winehq.org/git/wine.git/?a=commit;h=129f48a69224c7fa7d46577483...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Dec 14 21:38:10 2011 +0100
comctl32: Don't try to mask out the image for palette-based bitmaps.
---
dlls/comctl32/imagelist.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index db59104..0914c09 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -543,8 +543,6 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask) SetBkColor (hdcBitmap, bkColor); BitBlt (hdcMask, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY);
- SetBkColor(hdcBitmap, RGB(255,255,255)); - /* * Remove the background from the image * @@ -558,7 +556,11 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask) * * Blt mode 0x220326 is NOTSRCAND */ - BitBlt(hdcBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcMask, 0, 0, 0x220326); + if (bmp.bmBitsPixel > 8) /* NOTSRCAND can't work with palettes */ + { + SetBkColor(hdcBitmap, RGB(255,255,255)); + BitBlt(hdcBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, hdcMask, 0, 0, 0x220326); + }
DeleteDC(hdcBitmap); DeleteDC(hdcMask);