Evan Stade : gdiplus: Partial implementation of GdipDrawImagePointsRect.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 31 07:54:49 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Mon Jul 30 19:10:07 2007 -0700

gdiplus: Partial implementation of GdipDrawImagePointsRect.

---

 dlls/gdiplus/graphics.c |   41 ++++++++++++++++++++++++++++++++---------
 1 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 7b19db0..80684ff 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1024,20 +1024,43 @@ GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
     return retval;
 }
 
+/* FIXME: partially implemented */
 GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image,
-    GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
-    REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
-    DrawImageAbort callback, VOID * callbackData)
+     GDIPCONST GpPointF *points, INT count, REAL srcx, REAL srcy, REAL srcwidth,
+     REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes* imageAttributes,
+     DrawImageAbort callback, VOID * callbackData)
 {
-    static int calls;
+    GpPointF ptf[3];
+    POINT pti[3];
 
-    if(!graphics || !image || !points || !imageAttributes)
-        return InvalidParameter;
+    TRACE("%p %p %p %d %f %f %f %f %d %p %p %p\n", graphics, image, points, count,
+          srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback,
+          callbackData);
 
-    if(!(calls++))
-        FIXME("not implemented\n");
+    if(!graphics || !image || !points || !imageAttributes || count != 3)
+         return InvalidParameter;
 
-    return NotImplemented;
+    if(image->type != ImageTypeMetafile)
+        return NotImplemented;
+    if((points[0].X != points[2].X) || (points[0].Y != points[1].Y))
+        return NotImplemented;
+    if(srcUnit != UnitInch)
+        return NotImplemented;
+
+    memcpy(ptf, points, 3 * sizeof(GpPointF));
+    transform_and_round_points(graphics, pti, ptf, 3);
+
+    if(IPicture_Render(image->picture, graphics->hdc,
+        pti[0].x, pti[0].y, pti[1].x - pti[0].x, pti[2].y - pti[0].y,
+        srcx * INCH_HIMETRIC, srcy * INCH_HIMETRIC,
+        srcwidth * INCH_HIMETRIC, srcheight * INCH_HIMETRIC,
+        NULL) != S_OK){
+        if(callback)
+            callback(callbackData);
+        return GenericError;
+    }
+
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics *graphics, GpPen *pen, INT x1,




More information about the wine-cvs mailing list