user32: Correct scaling of DrawIcon.

This commit is contained in:
Wilfried Pasquazzo 2009-09-22 14:20:28 +00:00 committed by Alexandre Julliard
parent 4a61c1d265
commit 32ca9b27c3
1 changed files with 9 additions and 3 deletions

View File

@ -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 );
}
}