[4/4] gdiplus: When there is no target rectangle specified DrawImage should scale image to device dpi.

Dmitry Timoshkov dmitry at baikal.ru
Tue Aug 7 22:39:39 CDT 2012


This makes its dimensions in logical units stay unchanged.
---
 dlls/gdiplus/graphics.c    | 2 ++
 dlls/gdiplus/tests/image.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 4606074..dfa37eb 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -2974,7 +2974,9 @@ GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image,
     TRACE("(%p, %p, %f, %f, %f, %f, %f, %f, %d)\n", graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
 
     scale_x = units_scale(srcUnit, graphics->unit, graphics->xres);
+    scale_x *= graphics->xres / image->xres;
     scale_y = units_scale(srcUnit, graphics->unit, graphics->yres);
+    scale_y *= graphics->yres / image->yres;
     width = srcwidth * scale_x;
     height = srcheight * scale_y;
 
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index fbcb969..c58c52f 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -3650,7 +3650,6 @@ static void test_DrawImage(void)
     expect(8, data.Stride);
     expect(PixelFormat24bppRGB, data.PixelFormat);
     match = memcmp(data.Scan0, black_2x2, sizeof(black_2x2)) == 0;
-todo_wine
     ok(match, "data should match\n");
     if (!match)
     {
@@ -3713,7 +3712,6 @@ static void test_GdipDrawImagePointRect(void)
     expect(8, data.Stride);
     expect(PixelFormat24bppRGB, data.PixelFormat);
     match = memcmp(data.Scan0, black_2x2, sizeof(black_2x2)) == 0;
-todo_wine
     ok(match, "data should match\n");
     if (!match)
     {
-- 
1.7.11.4




More information about the wine-patches mailing list