Evan Stade : gdiplus: Implemented GdipDrawArc.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Jun 20 09:13:43 CDT 2007
Module: wine
Branch: master
Commit: c42f8794a1519ac0dba46c7c638372ba3310b121
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c42f8794a1519ac0dba46c7c638372ba3310b121
Author: Evan Stade <estade at gmail.com>
Date: Tue Jun 19 19:31:19 2007 -0700
gdiplus: Implemented GdipDrawArc.
---
dlls/gdiplus/gdiplus.spec | 2 +-
dlls/gdiplus/graphics.c | 25 +++++++++++++++++++++++++
include/gdiplusflat.h | 1 +
3 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 4916853..3036155 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
@ stdcall GdipDrawBezier(ptr ptr long long long long long long long long)
@ stub GdipDrawBezierI
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index b455cc4..a4ba0ca 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -116,6 +116,31 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
return Ok;
}
+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;
+}
+
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics *graphics, GpPen *pen, REAL x1,
REAL y1, REAL x2, REAL y2, REAL x3, REAL y3, REAL x4, REAL y4)
{
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index e949301..538f1f4 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -31,6 +31,7 @@ GpStatus WINGDIPAPI GdipDeletePen(GpPen*);
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC,GpGraphics**);
GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**);
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *);
+GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,
REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawLineI(GpGraphics*,GpPen*,INT,INT,INT,INT);
More information about the wine-cvs
mailing list