[PATCH 2/2] user32: Correct scaling of DrawIcon, fixes Bug 175

Wilfried Pasquazzo wilfried.pasquazzo at gmail.com
Tue Sep 22 12:08:17 CDT 2009


Hi again,

Makes Wine pass new test of [PATCH 1/2] and Fixes Bug 175 (
http://bugs.winehq.org/show_bug.cgi?id=175)

modified file(s): dlls/user32/cursoricon.c

Best regards


Wilfried Pasquazzo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20090922/3b73ff5a/attachment.htm>
-------------- next part --------------
From a9fd665c7bdf2dbe63ca131964f26a300ee0b704 Mon Sep 17 00:00:00 2001
From: Wilfried Pasquazzo <wilfried.pasquazzo at gmail.com>
Date: Tue, 22 Sep 2009 14:20:28 +0000
Subject: [PATCH 2/2] user32: Correct scaling of DrawIcon, fixes Bug 175

---
 dlls/user32/cursoricon.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 48a1a59..0574338 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -1715,7 +1715,9 @@ BOOL WINAPI DrawIcon( HDC hdc, INT x, INT y, HICON hIcon )
             /* Do the alpha blending render */
             premultiply_alpha_channel(dibBits, xorBitmapBits, dibLength);
             hBitTemp = SelectObject( hMemDC, hXorBits );
-            GdiAlphaBlend(hdc, x, y, ptr->nWidth, ptr->nHeight, hMemDC,
+	    /* Destination width/height has to be "System Large" size */
+            GdiAlphaBlend(hdc, x, y, GetSystemMetrics(SM_CXICON), 
+	                    GetSystemMetrics(SM_CYICON), hMemDC,
                             0, 0, ptr->nWidth, ptr->nHeight, pixelblend);
             SelectObject( hMemDC, hBitTemp );
         }
@@ -1729,9 +1731,13 @@ BOOL WINAPI DrawIcon( HDC hdc, INT x, INT y, HICON hIcon )
         if (hXorBits && hAndBits)
         {
             hBitTemp = SelectObject( hMemDC, hAndBits );
-            BitBlt( hdc, x, y, ptr->nWidth, ptr->nHeight, hMemDC, 0, 0, SRCAND );
+            StretchBlt( hdc, x, y, GetSystemMetrics(SM_CXICON),
+	                    GetSystemMetrics(SM_CYICON), hMemDC, 0, 0, 
+			    ptr->nWidth, ptr->nHeight, SRCAND );
             SelectObject( hMemDC, hXorBits );
-            BitBlt(hdc, x, y, ptr->nWidth, ptr->nHeight, hMemDC, 0, 0,SRCINVERT);
+            StretchBlt( hdc, x, y, GetSystemMetrics(SM_CXICON),
+	                    GetSystemMetrics(SM_CYICON), hMemDC, 0, 0,
+			    ptr->nWidth, ptr->nHeight, SRCINVERT );
             SelectObject( hMemDC, hBitTemp );
         }
     }
-- 
1.6.3.3


More information about the wine-patches mailing list