Nikolay Sivov : gdiplus: Implemented GdipDrawCurve/GdipDrawCurveI.

Alexandre Julliard julliard at winehq.org
Tue Apr 29 08:54:38 CDT 2008


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Tue Apr 29 00:09:55 2008 +0400

gdiplus: Implemented GdipDrawCurve/GdipDrawCurveI.

---

 dlls/gdiplus/gdiplus.spec |    4 ++--
 dlls/gdiplus/graphics.c   |   31 +++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 298c5f7..d2baa36 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -167,8 +167,8 @@
 @ stdcall GdipDrawCurve2I(ptr ptr ptr long long)
 @ stub GdipDrawCurve3
 @ stub GdipDrawCurve3I
-@ stub GdipDrawCurve
-@ stub GdipDrawCurveI
+@ stdcall GdipDrawCurve(ptr ptr ptr long)
+@ stdcall GdipDrawCurveI(ptr ptr ptr long)
 @ stub GdipDrawDriverString
 @ stub GdipDrawEllipse
 @ stub GdipDrawEllipseI
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index d918d99..b011ef7 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1006,6 +1006,37 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1,
     return retval;
 }
 
+GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen,
+    GDIPCONST GpPointF *points, INT count)
+{
+    return GdipDrawCurve2(graphics,pen,points,count,1.0);
+}
+
+GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics *graphics, GpPen *pen,
+    GDIPCONST GpPoint *points, INT count)
+{
+    GpPointF *pointsF;
+    GpStatus ret;
+    INT i;
+
+    if(!points || count <= 0)
+        return InvalidParameter;
+
+    pointsF = GdipAlloc(sizeof(GpPointF)*count);
+    if(!pointsF)
+        return OutOfMemory;
+
+    for(i = 0; i < count; i++){
+        pointsF[i].X = (REAL)points[i].X;
+        pointsF[i].Y = (REAL)points[i].Y;
+    }
+
+    ret = GdipDrawCurve(graphics,pen,pointsF,count);
+    GdipFree(pointsF);
+
+    return ret;
+}
+
 /* Approximates cardinal spline with Bezier curves. */
 GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics *graphics, GpPen *pen,
     GDIPCONST GpPointF *points, INT count, REAL tension)




More information about the wine-cvs mailing list