fix TAG_BITMAP redzone overwrite for colordepths != 32 bit

svn path=/trunk/; revision=30790
This commit is contained in:
Christoph von Wittich 2007-11-26 20:45:05 +00:00
parent e611490600
commit f63f322ecb

View file

@ -1401,8 +1401,7 @@ UserDrawIconEx(
}
/* NtGdiCreateCompatibleBitmap will create a monochrome bitmap
when cxWidth or cyHeight is 0
*/
when cxWidth or cyHeight is 0 */
if ((bmpColor.bmBitsPixel == 32) && (cxWidth != 0) && (cyHeight != 0))
{
bAlpha = TRUE;
@ -1425,6 +1424,9 @@ UserDrawIconEx(
if (DoFlickerFree || bAlpha)
{
RECT r;
BITMAP bm;
BITMAPOBJ *BitmapObj = NULL;
r.right = cxWidth;
r.bottom = cyHeight;
@ -1442,6 +1444,21 @@ UserDrawIconEx(
goto cleanup;
}
/* make sure we have a 32 bit offscreen bitmap
otherwise we can't do alpha blending */
BitmapObj = BITMAPOBJ_LockBitmap(hbmOff);
if (BitmapObj == NULL)
{
DPRINT1("GDIOBJ_LockObj() failed!\n");
goto cleanup;
}
BITMAP_GetObject(BitmapObj, sizeof(BITMAP), &bm);
if (bm.bmBitsPixel != 32)
bAlpha = FALSE;
BITMAPOBJ_UnlockBitmap(BitmapObj);
hOldOffBmp = NtGdiSelectObject(hdcOff, hbmOff);
if (!hOldOffBmp)
{