[GDI+ implementation: 6/8] GdipDrawArc

Evan Stade estade at gmail.com
Tue Jun 12 12:58:55 CDT 2007


Hi,

Changelog:
*implemented GdipDrawArc

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   25 +++++++++++++++++++++++++
 include/gdiplusflat.h     |    1 +
 3 files changed, 27 insertions(+), 1 deletions(-)

-Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index b60107a..b7fb180 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -142,7 +142,7 @@
 @ stub GdipDeleteStringFormat
 @ stub GdipDisposeImage
 @ stub GdipDisposeImageAttributes
-@ stub GdipDrawArc
+@ stdcall GdipDrawArc(ptr ptr long long long long long long)
 @ stub GdipDrawArcI
 @ stub GdipDrawBezier
 @ stub GdipDrawBezierI
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 5ca76d2..4745d20 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -182,3 +182,28 @@ GpStatus WINGDIPAPI GdipDrawPie(GpGraphi
     return DrawPie(graphics, GetStockObject(NULL_BRUSH), pen->gdipen, x, y, 
         width, height, startAngle, sweepAngle);
 }
+
+GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x, 
+    REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
+{
+    HGDIOBJ old_pen;
+    REAL x_0, y_0, x_1, y_1, x_2, y_2;
+
+    if(!graphics || !pen)
+        return InvalidParameter;
+
+    old_pen = SelectObject(graphics->hdc, pen->gdipen);
+
+    x_0 = x + (width/2.0);
+    y_0 = y + (height/2.0);
+
+    deg2xy(startAngle+sweepAngle, x_0, y_0, &x_1, &y_1);
+    deg2xy(startAngle, x_0, y_0, &x_2, &y_2);
+
+    Arc(graphics->hdc, roundr(x), roundr(y), roundr(x+width), roundr(y+height),
+        roundr(x_1), roundr(y_1), roundr(x_2), roundr(y_2));
+
+    SelectObject(graphics->hdc, old_pen);
+
+    return Ok;
+}
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 2d4e13f..8a3a0ee 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -35,6 +35,7 @@ GpStatus WINGDIPAPI GdipDrawLineI(GpGrap
 GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT);
 GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipDrawPie(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
+GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
 
 GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
 GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);
-- 
1.4.1


More information about the wine-patches mailing list