Easy Way to Learn ASP.NET

GDI+ Tutorial

GDI+ Introduction
GDI+ Lines
GDI+ Rectangles
GDI+ Ellipses
GDI+ Arcs
GDI+ Polygons
GDI+ Cardinal Splines
GDI+ Bezier Splines
GDI+ Graphics Paths
GDI+ Brushes
GDI+ Regions
GDI+ Antialiasing
GDI+ Bitmaps
GDI+ Metafiles
GDI+ Transformations
GDI+ Text

Drawing Arcs Using GDI+

An arc is a portion of an ellipse. To draw an arc, you call the DrawArc method of the Graphics class.


Drawing an Arc

To draw an arc, call the DrawArc method of the Graphic object. The parameters of the DrawArc method are the same as the parameters of the DrawEllipse method, except that DrawArc requires a starting angle and sweep angle.

The following is the syntax of the DrawArc method:

DrawArc(ByVal pen As System.Drawing.Pen, ByVal x As Single, ByVal y As Single, ByVal width As Single, ByVal height As Single, ByVal startAngle As Single, ByVal sweepAngle As Single)

The following code example demonstrates how to draw an arc with starting angle 30 degrees and a sweep angle of 180 degrees: