Commit d87715c8 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Don't try to alpha blend icons when drawing to a monochrome device.

parent cdf69470
...@@ -2054,11 +2054,21 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon, ...@@ -2054,11 +2054,21 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
if (ptr->alpha && (flags & DI_IMAGE)) if (ptr->alpha && (flags & DI_IMAGE))
{ {
BLENDFUNCTION pixelblend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA }; BOOL is_mono = FALSE;
SelectObject( hMemDC, ptr->alpha ); if (GetObjectType( hdc_dest ) == OBJ_MEMDC)
if (GdiAlphaBlend( hdc_dest, x, y, cxWidth, cyWidth, hMemDC, {
0, 0, ptr->width, ptr->height, pixelblend )) goto done; 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) if (flags & DI_MASK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment