From b675c1a92ea3d4c3429927b3bf92c766581f0f5c Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 24 Mar 2005 15:07:40 +0000 Subject: [PATCH] The depth of the colour bitmap needs to match that of the screen. --- dlls/comctl32/imagelist.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index df6836c1989..a88c36e0a94 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -1405,14 +1405,19 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) TRACE("%p %d %d\n", himl, i, fStyle); if (!is_valid(himl) || (i < 0) || (i >= himl->cCurImage)) return NULL; - hdcDst = CreateCompatibleDC(0); - ii.fIcon = TRUE; ii.xHotspot = 0; ii.yHotspot = 0; + /* create colour bitmap */ + hdcDst = GetDC(0); + ii.hbmColor = CreateCompatibleBitmap(hdcDst, himl->cx, himl->cy); + ReleaseDC(0, hdcDst); + + hdcDst = CreateCompatibleDC(0); + /* draw mask*/ - ii.hbmMask = CreateCompatibleBitmap (hdcDst, himl->cx, himl->cy); + ii.hbmMask = CreateBitmap (himl->cx, himl->cy, 1, 1, NULL); hOldDstBitmap = SelectObject (hdcDst, ii.hbmMask); if (himl->hbmMask) { BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, @@ -1422,7 +1427,6 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle) PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS); /* draw image*/ - ii.hbmColor = CreateCompatibleBitmap (himl->hdcImage, himl->cx, himl->cy); SelectObject (hdcDst, ii.hbmColor); BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, himl->hdcImage, i * himl->cx, 0, SRCCOPY); -- 2.11.4.GIT