[PATCH 0/1] MR10389: comctl32/static: Set HALFTONE StretchBlt mode in STATIC_PaintBitmapfn().
From: Paul Gofman <pgofman@codeweavers.com> --- dlls/comctl32_v6/static.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/comctl32_v6/static.c b/dlls/comctl32_v6/static.c index c243d3f871e..a39812dc65f 100644 --- a/dlls/comctl32_v6/static.c +++ b/dlls/comctl32_v6/static.c @@ -859,6 +859,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style HDC hMemDC; HBITMAP hBitmap, oldbitmap; RECT rcClient; + int prev_mode; GetClientRect( hwnd, &rcClient ); FillRect( hdc, &rcClient, hbrush ); @@ -890,6 +891,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style rcClient.bottom = rcClient.top + bm.bmHeight; } + prev_mode = SetStretchBltMode( hdc, HALFTONE ); if (extra->image_has_alpha) GdiAlphaBlend(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hMemDC, @@ -898,6 +900,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, HBRUSH hbrush, DWORD style StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); + SetStretchBltMode( hdc, prev_mode ); SelectObject(hMemDC, oldbitmap); DeleteDC(hMemDC); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10389
That fixes overly aliased image in Death Stranding 2 launcher settings dialog (which gets scaled 2400x200 -\> 900x75 but is properly antialiased on Windows). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10389#note_132925
Zhiyi Zhang (@zhiyi) commented about dlls/comctl32_v6/static.c:
StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY); + SetStretchBltMode( hdc, prev_mode );
Let's not add spaces inside the parentheses. The code nearby doesn't have them. Otherwise, it looks good to me. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10389#note_132932
participants (3)
-
Paul Gofman -
Paul Gofman (@gofman) -
Zhiyi Zhang (@zhiyi)