uxtheme: Use StretchBlt() when resizing a source image for tiling.

For example, when a theme part has a source image with 0xff00ff as transparent pixels and the sizing
margin is larger than the destination, the source image is first resized to fit the destination,
during which, StretchBlt() should be used instead of TransparentBlt() because the image should not
be blended with the temporary memory device context.

Fix group box background may be drawn in black.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhiyi Zhang 2021-11-30 14:50:33 +08:00 committed by Alexandre Julliard
parent 9c5fa40ebd
commit bcbe1bcff3
1 changed files with 2 additions and 1 deletions

View File

@ -779,8 +779,9 @@ static HRESULT UXTHEME_DrawImageBackground(HTHEME hTheme, HDC hdc, int iPartId,
bmpSrcResized = CreateBitmap(srcSize.x, srcSize.y, 1, 32, NULL);
SelectObject(hdcSrc, bmpSrcResized);
/* Use ALPHABLEND_NONE because the image is getting resized, rather than blended with the target */
UXTHEME_StretchBlt(hdcSrc, 0, 0, srcSize.x, srcSize.y, hdcOrigSrc, rcSrc.left, rcSrc.top,
rcSrc.right - rcSrc.left, rcSrc.bottom - rcSrc.top, transparent, transparentcolor);
rcSrc.right - rcSrc.left, rcSrc.bottom - rcSrc.top, ALPHABLEND_NONE, 0);
rcSrc.left = 0;
rcSrc.top = 0;