Vincent Povirk : gdiplus: Implement GdipBitmapSetResolution.

Alexandre Julliard julliard at winehq.org
Mon Dec 28 09:16:11 CST 2009


Module: wine
Branch: master
Commit: 6bb300fa41176822f5ec6ce4e0842cf39d6239e9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6bb300fa41176822f5ec6ce4e0842cf39d6239e9

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Sat Dec 26 21:05:58 2009 -0500

gdiplus: Implement GdipBitmapSetResolution.

---

 dlls/gdiplus/image.c       |   10 ++++++++--
 dlls/gdiplus/tests/image.c |   10 +++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index 763c17c..78801fd 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -535,9 +535,15 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
 
 GpStatus WINGDIPAPI GdipBitmapSetResolution(GpBitmap* bitmap, REAL xdpi, REAL ydpi)
 {
-    FIXME("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi);
+    TRACE("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi);
 
-    return NotImplemented;
+    if (!bitmap || xdpi == 0.0 || ydpi == 0.0)
+        return InvalidParameter;
+
+    bitmap->image.xres = xdpi;
+    bitmap->image.yres = ydpi;
+
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c
index 913ba1f..e93b745 100644
--- a/dlls/gdiplus/tests/image.c
+++ b/dlls/gdiplus/tests/image.c
@@ -915,10 +915,10 @@ static void test_resolution(void)
     expect(InvalidParameter, stat);
 
     stat = GdipBitmapSetResolution(NULL, 96.0, 96.0);
-    todo_wine expect(InvalidParameter, stat);
+    expect(InvalidParameter, stat);
 
     stat = GdipBitmapSetResolution(bitmap, 0.0, 0.0);
-    todo_wine expect(InvalidParameter, stat);
+    expect(InvalidParameter, stat);
 
     /* defaults to screen resolution */
     screendc = GetDC(0);
@@ -938,15 +938,15 @@ static void test_resolution(void)
 
     /* test changing the resolution */
     stat = GdipBitmapSetResolution(bitmap, screenxres*2.0, screenyres*3.0);
-    todo_wine expect(Ok, stat);
+    expect(Ok, stat);
 
     stat = GdipGetImageHorizontalResolution((GpImage*)bitmap, &res);
     expect(Ok, stat);
-    todo_wine expectf(screenxres*2.0, res);
+    expectf(screenxres*2.0, res);
 
     stat = GdipGetImageVerticalResolution((GpImage*)bitmap, &res);
     expect(Ok, stat);
-    todo_wine expectf(screenyres*3.0, res);
+    expectf(screenyres*3.0, res);
 
     stat = GdipDisposeImage((GpImage*)bitmap);
     expect(Ok, stat);




More information about the wine-cvs mailing list