Graphics.DrawArc(const Pen*, const Rect, REAL, REAL) method
Applies to: desktop apps only
The Graphics::DrawArc method draws an arc. The arc is part of an ellipse.
Syntax
Status DrawArc(
[in] const Pen *pen,
[in, ref] const Rect &rect,
[in] REAL startAngle,
[in] REAL sweepAngle
);
Parameters
pen [in]
Type: const Pen*Pointer to a pen that is used to draw the arc.
rect [in, ref]
Type: const RectReference to the rectangle that bounds the ellipse that contains the arc.
startAngle [in]
Type: REALReal number that specifies the angle between the x-axis and the starting point of the arc.
sweepAngle [in]
Type: REALReal number that specifies the angle between the starting and ending points of the arc.
Return value
Type:
Type: Status****
If the method succeeds, it returns Ok, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
Examples
The following example draws a 90-degree arc.
VOID Example_DrawArc(HDC hdc)
{
Graphics graphics(hdc);
// Set up the arc.
Pen redPen(Color(255, 255, 0, 0), 3);
Rect ellipseRect(0, 0, 200, 100);
REAL startAngle = 0.0f;
REAL sweepAngle = 90.0f;
// Draw the arc.
graphics.DrawArc(&redPen, ellipseRect, startAngle, sweepAngle);
}
Requirements
Minimum supported client |
Windows XP, Windows 2000 Professional |
Minimum supported server |
Windows 2000 Server |
Product |
GDI+ 1.0 |
Header |
Gdiplusgraphics.h (include Gdiplus.h) |
Library |
Gdiplus.lib |
DLL |
Gdiplus.dll |
See also
Creating Figures from Lines, Curves, and Shapes
Send comments about this topic to Microsoft
Build date: 3/6/2012