[PATCH 1/4] uxtheme: Use StretchBlt() when resizing a source image for tiling.

Zhiyi Zhang zzhang at codeweavers.com
Tue Nov 30 00:50:33 CST 2021


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 at codeweavers.com>
---
 dlls/uxtheme/draw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/uxtheme/draw.c b/dlls/uxtheme/draw.c
index bf294ed3cc8..04ea1e79df9 100644
--- a/dlls/uxtheme/draw.c
+++ b/dlls/uxtheme/draw.c
@@ -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;
-- 
2.32.0




More information about the wine-devel mailing list