Mega Code Archive

 
Categories / Silverlight / Shapes
 

Elliptic Arcs with ArcSegment Objects

<UserControl x:Class='SilverlightApplication3.MainPage'     xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'      xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'     xmlns:d='http://schemas.microsoft.com/expression/blend/2008'      xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006'      mc:Ignorable='d'      d:DesignWidth='640'      d:DesignHeight='480'>     <Canvas>         <Path Fill="Red" Stroke="Blue"             StrokeDashArray="4 1 4 4"             StrokeThickness="4">         <Path.Data>              <PathGeometry>           <PathGeometry.Figures>             <PathFigure StartPoint="50,50">               <PathFigure.Segments>                 <ArcSegment                   Size="150,120" RotationAngle="120"                   IsLargeArc="True"                   SweepDirection="Clockwise"                   Point="300,250"/>               </PathFigure.Segments>             </PathFigure>           </PathGeometry.Figures>         </PathGeometry>       </Path.Data>     </Path>          <Path Fill="Blue" Stroke="Red"           StrokeDashArray="8 1 6 4"           StrokeThickness="4">       <Path.Data>         <PathGeometry>            <PathGeometry.Figures>              <PathFigure StartPoint="150,150">                      <PathFigure.Segments>                   <ArcSegment                     Size="150,120" RotationAngle="160"                     IsLargeArc="True"                     SweepDirection="CounterClockwise"                     Point="300,350"/>                 </PathFigure.Segments>               </PathFigure>             </PathGeometry.Figures>           </PathGeometry>         </Path.Data>       </Path>      </Canvas> </UserControl>