Files
docs-desktop/dotnet-desktop-guide/framework/wpf/graphics-multimedia/how-to-create-an-elliptical-arc.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

2.2 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Create an Elliptical Arc 03/30/2017
graphics [WPF], elliptical arcs
elliptical arcs [WPF], creating
arcs [WPF], elliptical
3dcfe502-3485-45de-99fb-d53a1367c484

How to: Create an Elliptical Arc

This example shows how to draw an elliptical arc. To create an elliptical arc, use the xref:System.Windows.Media.PathGeometry, xref:System.Windows.Media.PathFigure, and xref:System.Windows.Media.ArcSegment classes.

Example

In the following examples, an elliptical arc is drawn from (10,100) to (200,100). The arc has a xref:System.Windows.Media.ArcSegment.Size%2A of 100 by 50 device-independent pixels, a xref:System.Windows.Media.ArcSegment.RotationAngle%2A of 45 degrees, an xref:System.Windows.Media.ArcSegment.IsLargeArc%2A setting of true, and a xref:System.Windows.Media.ArcSegment.SweepDirection%2A of xref:System.Windows.Media.SweepDirection.Counterclockwise.

[xaml]

In [!INCLUDETLA#tla_xaml], you can use attribute syntax to describe a path.

[!code-xamlGeometrySample#56]

[xaml]

(Note that this attribute syntax actually creates a xref:System.Windows.Media.StreamGeometry, a lighter-weight version of a xref:System.Windows.Media.PathGeometry. For more information, see the Path Markup Syntax page.)

In [!INCLUDETLA2#tla_xaml], you can also draw an elliptical arc by explicitly using object tags. The following is equivalent to the preceding [!INCLUDETLA2#tla_xaml] markup.

[!code-xamlGeometrySample#36]

This example is part of a larger sample. For the complete sample, see the Geometries Sample.

See also