More elaborate IsThemeBackgroundPartiallyTransparent() implementation;

also returns TRUE for theme parts with 32bpp images.
This commit is contained in:
Frank Richter 2005-08-30 09:58:41 +00:00 committed by Alexandre Julliard
parent 5c87552f6a
commit a18042e77f
1 changed files with 23 additions and 3 deletions

View File

@ -1849,8 +1849,28 @@ HRESULT WINAPI GetThemeTextMetrics(HTHEME hTheme, HDC hdc, int iPartId,
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId,
int iStateId) int iStateId)
{ {
BOOL transparent = FALSE; int bgtype = BT_BORDERFILL;
RECT rect = {0, 0, 0, 0};
HBITMAP bmpSrc;
RECT rcSrc;
BOOL hasAlpha;
INT transparent;
COLORREF transparentcolor;
TRACE("(%d,%d)\n", iPartId, iStateId); TRACE("(%d,%d)\n", iPartId, iStateId);
GetThemeBool(hTheme, iPartId, iStateId, TMT_TRANSPARENT, &transparent);
return transparent; if(!hTheme)
return FALSE;
GetThemeEnumValue(hTheme, iPartId, iStateId, TMT_BGTYPE, &bgtype);
if (bgtype != BT_IMAGEFILE) return FALSE;
if(FAILED (UXTHEME_LoadImage (hTheme, 0, iPartId, iStateId, &rect, FALSE,
&bmpSrc, &rcSrc, &hasAlpha)))
return FALSE;
get_transparency (hTheme, iPartId, iStateId, hasAlpha, &transparent,
&transparentcolor, FALSE);
return (transparent != ALPHABLEND_NONE);
} }