PolyLine Segment Demo


   
     

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Path Fill="Aqua" Stroke="Maroon" StrokeThickness="3">
        <Path.Data>
            <PathGeometry>
                <PathFigure StartPoint="144 72" IsClosed="True">
                    <PolyLineSegment Points="200 246, 53 138, 235 138, 88 246" />
                </PathFigure>
            </PathGeometry>
        </Path.Data>
    </Path>
</Canvas>

   
    
    
    
    
     


Polyline and Polyline.Points


   
     
<Window x:Class="WpfApplication1.ShapesWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ShapesWindow" Height="160" Width="400">
    <Canvas>
        <Polyline Stroke="Brown" StrokeThickness="4" StrokeDashArray="1 1" Canvas.Left="119" Canvas.Top="170" >
            <Polyline.Points>
                <Point X="0" Y="0"/>
                <Point X="30" Y="30"/>
                <Point X="60" Y="20"/>
                <Point X="100" Y="50"/>
            </Polyline.Points>
        </Polyline>
    </Canvas>
</Window>

   
    
    
    
    
     


Ployline types do not require connecting ends


   
     
<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WpfApplication1" Height="352" Width="334" WindowStartupLocation="CenterScreen">
    <StackPanel>
    <Polyline Stroke ="Red" StrokeThickness ="20" StrokeLineJoin ="Round" 
                 Points ="10,10   40,40  10,90   300,50"/>
    </StackPanel>
</Window>

   
    
    
    
    
     


Rotates the Polyline 45 degrees about the relative origin (0.25,0.25).


   
     
<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
        <Canvas Height="200" Width="200">
          <Polyline 
            Points="25,25 0,50 25,75 50,50 25,25 25,0" 
            Stroke="Blue" StrokeThickness="10"
            Canvas.Left="75" Canvas.Top="50"
            RenderTransformOrigin="0.25,0.25">
            <Polyline.RenderTransform>
              <RotateTransform Angle="45" />
            </Polyline.RenderTransform>
          </Polyline>
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" Stroke="Blue" StrokeThickness="10"
            Opacity="0.25" Canvas.Left="75" Canvas.Top="50" />            
        </Canvas>

</Window>

   
    
    
    
    
     


Rotates the Polyline 45 degrees about its center


   
     
<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
        <Canvas Height="200" Width="200">
          <Polyline 
            Points="25,25 0,50 25,75 50,50 25,25 25,0" 
            Stroke="Blue" StrokeThickness="10"
            Canvas.Left="75" Canvas.Top="50"
            RenderTransformOrigin="0.5,0.5">
            <Polyline.RenderTransform>
              <RotateTransform Angle="45" />
            </Polyline.RenderTransform>
          </Polyline>
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" Stroke="Blue" StrokeThickness="10"
            Opacity="0.25" Canvas.Left="75" Canvas.Top="50" />            
        </Canvas>

</Window>

   
    
    
    
    
     


Rotates the Polyline 45 degrees about the point (0,0)


   
     
<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
        <Canvas Height="200" Width="200">
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" 
            Stroke="Blue" StrokeThickness="10"
            Canvas.Left="75" Canvas.Top="50">
            <Polyline.RenderTransform>
              <RotateTransform CenterX="0" CenterY="0" Angle="45" />
            </Polyline.RenderTransform>
          </Polyline>
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" Stroke="Blue" StrokeThickness="10"
            Opacity="0.25" Canvas.Left="75" Canvas.Top="50" />            
        </Canvas>

</Window>

   
    
    
    
    
     


Rotates the Polyline 45 degrees about the point (25,50)


   
     
<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
          <Polyline Points="25,25 0,50 25,75 50,50 25,25 25,0" 
            Stroke="Blue" StrokeThickness="10">
            <Polyline.RenderTransform>
              <RotateTransform CenterX="25" CenterY="50" Angle="45" />
            </Polyline.RenderTransform>
          </Polyline>

</Window>