Multiple Subpaths with PathFigure

image_pdfimage_print


   
   
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
              <PathGeometry>
                <PathGeometry.Figures>
                  <PathFigureCollection>
                    <PathFigure IsClosed="True" StartPoint="10,100">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <LineSegment Point="100,100" />
                          <LineSegment Point="100,50" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>
                    <PathFigure IsClosed="True" StartPoint="10,10">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <LineSegment Point="100,10" />
                          <LineSegment Point="100,40" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>                    
                  </PathFigureCollection>
                </PathGeometry.Figures>
              </PathGeometry>
            </Path.Data>
          </Path>
       
   </Canvas> 


</Window>

   
    
    
     


Close Path Command with PathFigure

image_pdfimage_print


   
   
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
              <PathGeometry>
                <PathGeometry.Figures>
                  <PathFigureCollection>
                    <PathFigure IsClosed="True" StartPoint="10,100">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <LineSegment Point="100,100" />
                          <LineSegment Point="100,50" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>
                  </PathFigureCollection>
                </PathGeometry.Figures>
              </PathGeometry>
            </Path.Data>
          </Path>
   </Canvas> 


</Window>

   
    
    
     


Drawn with a Path Shape with Geometry

image_pdfimage_print
   
   
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
            <Path.Data>
              <GeometryGroup>
                  <RectangleGeometry Rect="50,5 100,10" />
                  <RectangleGeometry Rect="5,5 95,180" />
                  <EllipseGeometry Center="100, 100" RadiusX="20" RadiusY="30"/>
                  <RectangleGeometry Rect="50,175 100,10" />
                  <PathGeometry>
                    <PathGeometry.Figures>
                      <PathFigureCollection>
                        <PathFigure IsClosed="true" StartPoint="50,50">
                          <PathFigure.Segments>
                            <PathSegmentCollection>
                              <BezierSegment Point1="75,300" Point2="125,100" Point3="150,50"/>
                              <BezierSegment Point1="125,300" Point2="75,100"  Point3="50,50"/>
                            </PathSegmentCollection>
                          </PathFigure.Segments>
                        </PathFigure>
                      </PathFigureCollection>
                    </PathGeometry.Figures>
                  </PathGeometry>               
              </GeometryGroup>
            </Path.Data>
          </Path>       
   </Canvas> 


</Window>

   
    
    
     


Vertical Line

image_pdfimage_print


   
   
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
              <PathGeometry>
                <PathGeometry.Figures>
                  <PathFigureCollection>
                    <PathFigure StartPoint="100,50">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <LineSegment Point="10,200" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>
                  </PathFigureCollection>
                </PathGeometry.Figures>
              </PathGeometry>
            </Path.Data>
          </Path>
   </Canvas> 


</Window>

   
    
    
     


Horizontal Line

image_pdfimage_print


   
   
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
              <PathGeometry>
                <PathGeometry.Figures>
                  <PathFigureCollection>
                    <PathFigure StartPoint="100,50">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <LineSegment Point="200,50" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>
                  </PathFigureCollection>
                </PathGeometry.Figures>
              </PathGeometry>
            </Path.Data>
          </Path>       
   </Canvas> 


</Window>

   
    
    
     


Cubic Bezier Curve with BezierSegment

image_pdfimage_print


   
   

<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
              <PathGeometry>
                <PathGeometry.Figures>
                  <PathFigureCollection>
                    <PathFigure StartPoint="10,100">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <BezierSegment Point1="100,0" Point2="200,200" Point3="300,100" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>
                  </PathFigureCollection>
                </PathGeometry.Figures>
              </PathGeometry>
            </Path.Data>
          </Path>
   </Canvas> 


</Window>

   
    
    
     


Line with PathGeometry

image_pdfimage_print


   
   
<Window  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SDKSample.SampleViewer"
    Title="  Examples" >

   <Canvas> 
          <Path Stroke="Black" StrokeThickness="1">
            <Path.Data>
              <PathGeometry>
                <PathGeometry.Figures>
                  <PathFigureCollection>
                    <PathFigure StartPoint="100,50">
                      <PathFigure.Segments>
                        <PathSegmentCollection>
                          <LineSegment Point="200,70" />
                        </PathSegmentCollection>
                      </PathFigure.Segments>
                    </PathFigure>
                  </PathFigureCollection>
                </PathGeometry.Figures>
              </PathGeometry>
            </Path.Data>
          </Path>
   </Canvas> 


</Window>