ArcSegment Class
Represents an elliptical arc between two points.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Use a PathFigure object to store ArcSegment objects and other segments.
An elliptical arc is defined by its start and end points, x- and y-radius, x-axis rotation factor, a value indicating whether the arc should be greater than 180 degrees, and a value describing the direction in which the arc is drawn. The ArcSegment class does not contain a property for the starting point of the arc; it only defines the destination point of the arc it represents. The beginning point of the arc is the current point of the PathFigure to which the ArcSegment is added.
The following illustrations demonstrate the different end point, Size, and RotationAngle settings.



IsLargeArc and SweepDirection
For most arcs of a particular position, size, and rotation, there are four different arcs that can be drawn; the IsLargeArc and SweepDirection properties indicate which arc to use.
Of the four candidate arc sweeps, two represent large arcs with sweeps of 180 degrees or greater, and two represent smaller arcs with sweeps 180 degrees or less. If IsLargeArc is true, then one of the two larger arc sweeps is chosen; otherwise, if is false, one of the smaller arc sweeps is chosen. The remaining two arc candidates are each drawn in a different direction: Counterclockwise or Clockwise. The SweepDirection property specifies which one to use.
The following illustrations show different IsLargeArc and SweepDirection settings.


Freezable Features
An ArcSegment is a type of Freezable object. For information about Freezable features, such as freezing and cloning, see the Freezable Objects Overview.
This example shows how to draw an elliptical arc. To create an elliptical arc, use the PathGeometry, PathFigure, and ArcSegment classes.
In the following examples, an elliptical arc is drawn from (10,100) to (200,100). The arc has a Size of 100 by 50 device-independent pixels, a RotationAngle of 45 degrees, an IsLargeArc setting of true, and a SweepDirection of Counterclockwise.
xamlIn Extensible Application Markup Language (XAML), you can use attribute syntax to describe a path.
<Path Stroke="Black" StrokeThickness="1" Data="M 10,100 A 100,50 45 1 0 200,100" />
(Note that this attribute syntax actually creates a StreamGeometry, a lighter-weight version of a PathGeometry. For more information, see the Path Markup Syntax page.)
In XAML, you can also draw an elliptical arc by explicitly using object tags. The following is equivalent to the preceding XAML markup.
<Path Stroke="Black" StrokeThickness="1"> <Path.Data> <PathGeometry> <PathGeometry.Figures> <PathFigureCollection> <PathFigure StartPoint="10,100"> <PathFigure.Segments> <PathSegmentCollection> <ArcSegment Size="100,50" RotationAngle="45" IsLargeArc="True" SweepDirection="CounterClockwise" Point="200,100" /> </PathSegmentCollection> </PathFigure.Segments> </PathFigure> </PathFigureCollection> </PathGeometry.Figures> </PathGeometry> </Path.Data> </Path>
This example is part of a larger sample. For the complete sample, see the Geometries Sample.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.