Wilfried Pasquazzo : user32: Correct scaling of DrawIcon.

Alexandre Julliard julliard at winehq.org
Wed Sep 23 11:03:25 CDT 2009


Module: wine
Branch: master
Commit: 32ca9b27c376af255dacd67c2744b3b5285b8cf1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=32ca9b27c376af255dacd67c2744b3b5285b8cf1

Author: Wilfried Pasquazzo <wilfried.pasquazzo at gmail.com>
Date:   Tue Sep 22 14:20:28 2009 +0000

user32: Correct scaling of DrawIcon.

---

 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..23de6a5 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 );
         }
     }




More information about the wine-cvs mailing list