user32: Don't try to alpha blend icons on low color bitmaps.

This commit is contained in:
Alexandre Julliard 2011-12-16 14:20:56 +01:00
parent e0fc985f32
commit 430c8aa910
1 changed files with 3 additions and 3 deletions

View File

@ -2288,15 +2288,15 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
if (frame->alpha && (flags & DI_IMAGE))
{
BOOL is_mono = FALSE;
BOOL alpha_blend = TRUE;
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;
alpha_blend = GetObjectW( bmp, sizeof(bm), &bm ) && bm.bmBitsPixel > 8;
}
if (!is_mono)
if (alpha_blend)
{
BLENDFUNCTION pixelblend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
SelectObject( hMemDC, frame->alpha );