Commit 10762860 authored by Filip Navara's avatar Filip Navara Committed by Alexandre Julliard

Fix TOOLBAR_DrawMasked to correctly use image list mask.

parent 0c3af0ba
...@@ -654,8 +654,7 @@ static void TOOLBAR_DrawMasked(HIMAGELIST himl, int index, HDC hdc, INT x, INT y ...@@ -654,8 +654,7 @@ static void TOOLBAR_DrawMasked(HIMAGELIST himl, int index, HDC hdc, INT x, INT y
/* Create src image */ /* Create src image */
hdcImage = CreateCompatibleDC(hdc); hdcImage = CreateCompatibleDC(hdc);
hbmImage = CreateBitmap(cx, cy, GetDeviceCaps(hdc,PLANES), hbmImage = CreateCompatibleBitmap(hdc, cx, cy);
GetDeviceCaps(hdc,BITSPIXEL), NULL);
SelectObject(hdcImage, hbmImage); SelectObject(hdcImage, hbmImage);
ImageList_DrawEx(himl, index, hdcImage, 0, 0, cx, cy, ImageList_DrawEx(himl, index, hdcImage, 0, 0, cx, cy,
RGB(0xff, 0xff, 0xff), RGB(0,0,0), draw_flags); RGB(0xff, 0xff, 0xff), RGB(0,0,0), draw_flags);
...@@ -666,8 +665,8 @@ static void TOOLBAR_DrawMasked(HIMAGELIST himl, int index, HDC hdc, INT x, INT y ...@@ -666,8 +665,8 @@ static void TOOLBAR_DrawMasked(HIMAGELIST himl, int index, HDC hdc, INT x, INT y
SelectObject(hdcMask, hbmMask); SelectObject(hdcMask, hbmMask);
/* Remove the background and all white pixels */ /* Remove the background and all white pixels */
SetBkColor(hdcImage, ImageList_GetBkColor(himl)); ImageList_DrawEx(himl, index, hdcMask, 0, 0, cx, cy,
BitBlt(hdcMask, 0, 0, cx, cy, hdcImage, 0, 0, SRCCOPY); RGB(0xff, 0xff, 0xff), RGB(0,0,0), ILD_MASK);
SetBkColor(hdcImage, RGB(0xff, 0xff, 0xff)); SetBkColor(hdcImage, RGB(0xff, 0xff, 0xff));
BitBlt(hdcMask, 0, 0, cx, cy, hdcImage, 0, 0, NOTSRCERASE); BitBlt(hdcMask, 0, 0, cx, cy, hdcImage, 0, 0, NOTSRCERASE);
......
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