user32: Correct scaling of DrawIcon.
This commit is contained in:
parent
4a61c1d265
commit
32ca9b27c3
|
@ -1715,7 +1715,9 @@ BOOL WINAPI DrawIcon( HDC hdc, INT x, INT y, HICON hIcon )
|
||||||
/* Do the alpha blending render */
|
/* Do the alpha blending render */
|
||||||
premultiply_alpha_channel(dibBits, xorBitmapBits, dibLength);
|
premultiply_alpha_channel(dibBits, xorBitmapBits, dibLength);
|
||||||
hBitTemp = SelectObject( hMemDC, hXorBits );
|
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);
|
0, 0, ptr->nWidth, ptr->nHeight, pixelblend);
|
||||||
SelectObject( hMemDC, hBitTemp );
|
SelectObject( hMemDC, hBitTemp );
|
||||||
}
|
}
|
||||||
|
@ -1729,9 +1731,13 @@ BOOL WINAPI DrawIcon( HDC hdc, INT x, INT y, HICON hIcon )
|
||||||
if (hXorBits && hAndBits)
|
if (hXorBits && hAndBits)
|
||||||
{
|
{
|
||||||
hBitTemp = SelectObject( hMemDC, 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 );
|
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 );
|
SelectObject( hMemDC, hBitTemp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue