user32: Don't try to alpha blend icons when drawing to a monochrome device.
This commit is contained in:
parent
cdf6947080
commit
d87715c831
|
@ -2054,12 +2054,22 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
|
|||
|
||||
if (ptr->alpha && (flags & DI_IMAGE))
|
||||
{
|
||||
BLENDFUNCTION pixelblend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
|
||||
BOOL is_mono = FALSE;
|
||||
|
||||
if (GetObjectType( hdc_dest ) == OBJ_MEMDC)
|
||||
{
|
||||
BITMAP bm;
|
||||
HBITMAP bmp = GetCurrentObject( hdc_dest, OBJ_BITMAP );
|
||||
is_mono = GetObjectW( bmp, sizeof(bm), &bm ) && bm.bmBitsPixel == 1;
|
||||
}
|
||||
if (!is_mono)
|
||||
{
|
||||
BLENDFUNCTION pixelblend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
|
||||
SelectObject( hMemDC, ptr->alpha );
|
||||
if (GdiAlphaBlend( hdc_dest, x, y, cxWidth, cyWidth, hMemDC,
|
||||
0, 0, ptr->width, ptr->height, pixelblend )) goto done;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & DI_MASK)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue