Commit bfe1ea26 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

user32: Select more appropriate stretch mode for colored images interpolation.

parent cbf1207b
...@@ -2976,6 +2976,8 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name, ...@@ -2976,6 +2976,8 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name,
} }
orig_bm = SelectObject(screen_mem_dc, hbitmap); orig_bm = SelectObject(screen_mem_dc, hbitmap);
if (info->bmiHeader.biBitCount > 1)
SetStretchBltMode(screen_mem_dc, HALFTONE);
StretchDIBits(screen_mem_dc, 0, 0, new_width, new_height, 0, 0, width, height, bits, fix_info, DIB_RGB_COLORS, SRCCOPY); StretchDIBits(screen_mem_dc, 0, 0, new_width, new_height, 0, 0, width, height, bits, fix_info, DIB_RGB_COLORS, SRCCOPY);
SelectObject(screen_mem_dc, orig_bm); SelectObject(screen_mem_dc, orig_bm);
...@@ -3217,6 +3219,8 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx, ...@@ -3217,6 +3219,8 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
void * bits; void * bits;
dc = CreateCompatibleDC(NULL); dc = CreateCompatibleDC(NULL);
if (ds.dsBm.bmBitsPixel > 1)
SetStretchBltMode(dc, HALFTONE);
bi->bmiHeader.biWidth = ds.dsBm.bmWidth; bi->bmiHeader.biWidth = ds.dsBm.bmWidth;
bi->bmiHeader.biHeight = ds.dsBm.bmHeight; bi->bmiHeader.biHeight = ds.dsBm.bmHeight;
......
...@@ -2918,9 +2918,9 @@ static void test_Image_StretchMode(void) ...@@ -2918,9 +2918,9 @@ static void test_Image_StretchMode(void)
sizeof(colors_bits_1), FALSE}, sizeof(colors_bits_1), FALSE},
{4, 4, 2, 2, 8, test_bits_8, expected_bits_8, {4, 4, 2, 2, 8, test_bits_8, expected_bits_8,
sizeof(test_bits_8), sizeof(expected_bits_8), colors_bits_8, sizeof(test_bits_8), sizeof(expected_bits_8), colors_bits_8,
sizeof(colors_bits_8), TRUE}, sizeof(colors_bits_8), FALSE},
{4, 4, 2, 2, 16, (const unsigned char *)test_bits_16, (const unsigned char *)expected_bits_16, {4, 4, 2, 2, 16, (const unsigned char *)test_bits_16, (const unsigned char *)expected_bits_16,
sizeof(test_bits_16), sizeof(expected_bits_16), NULL, 0, TRUE}, sizeof(test_bits_16), sizeof(expected_bits_16), NULL, 0, FALSE},
}; };
static const char filename[] = "test.bmp"; static const char filename[] = "test.bmp";
BITMAPINFO *bmi, *bmi_output; BITMAPINFO *bmi, *bmi_output;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment