imagelist: Fix GetIcon
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Wed Mar 23 09:16:55 CST 2005
Huw Davies <huw at codeweavers.com>
The depth of the colour bitmap needs to match that of the
screen.
--
Huw Davies
huw at codeweavers.com
Index: dlls/comctl32/imagelist.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/imagelist.c,v
retrieving revision 1.95
diff -u -p -r1.95 imagelist.c
--- dlls/comctl32/imagelist.c 24 Feb 2005 12:46:57 -0000 1.95
+++ dlls/comctl32/imagelist.c 23 Mar 2005 15:14:41 -0000
@@ -1405,14 +1405,19 @@ ImageList_GetIcon (HIMAGELIST himl, INT
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
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);
More information about the wine-patches
mailing list