Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ArcSegment Constructor (Point, Size, Double, Boolean, SweepDirection, Boolean)

Initializes a new instance of the ArcSegment class.

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public ArcSegment(
	Point point,
	Size size,
	double rotationAngle,
	bool isLargeArc,
	SweepDirection sweepDirection,
	bool isStroked
)

Parameters

point
Type: System.Windows.Point

The destination point of the arc; the start point of the arc is defined as the current point of the PathFigure to which the ArcSegment is added.

size
Type: System.Windows.Size

The x- and y-radius of the arc. The x-radius is specified by the Size structure's Width property, and the y-radius is specified by the Size structure's Height property.

rotationAngle
Type: System.Double

The x-axis rotation of the ellipse.

isLargeArc
Type: System.Boolean

Whether the arc should be greater than 180 degrees.

sweepDirection
Type: System.Windows.Media.SweepDirection

Set to Clockwise to draw the arc in a positive angle direction; set to Counterclockwise to draw the arc in a negative angle direction.

isStroked
Type: System.Boolean

Set to true to stroke the arc when a Pen is used to render the segment; otherwise, false.

The ArcSegment class defines only 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.

For most elliptical arcs of a particular position, size, and rotation, there are four different arcs that can be drawn; the largeArc and sweepDirection parameters 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 largeArc is true, then one of the two larger arc sweeps is chosen; otherwise, if largeArc is false, one of the smaller arc sweeps is chosen.

If sweepDirection is Clockwise, the arc is drawn in a positive-angle direction. If sweepDirection is Counterclockwise, the arc is drawn in a negative-angle direction.

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.

[xaml]

In 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" />

[xaml]

(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.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft