Create a simple line using the LineSegment and PathGeometry : Line « Windows Presentation Foundation « VB.Net






Create a simple line using the LineSegment and PathGeometry

Create a simple line using the LineSegment and PathGeometry
       

<Window x:Class="Main"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Combined Geometry" Height="340" Width="300">
  <Border Margin="5" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left">
    <Canvas Width="300" Height="340" Margin="5">

            <Path Stroke="Black">
              <Path.Data>
                <PathGeometry>
            
            
                  <PathFigure StartPoint="10,10">
                    <LineSegment Point="150,150" />
                    <LineSegment Point="150,200" />
            
            
                  </PathFigure>
                </PathGeometry>
              </Path.Data>
            </Path>
    </Canvas>
  </Border>
</Window>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Line position and color and thicknessLine position and color and thickness
2.Draw a LineDraw a Line
3.Add Line to StackPanelAdd Line to StackPanel
4.Set line Stroke and StrokeThicknessSet line Stroke and StrokeThickness
5.Add Line and TextBlock to CanvasAdd Line and TextBlock to Canvas
6.Set Line Along Canvas Top and LeftSet Line Along Canvas Top and Left
7.Draws a diagonal line from (10,10) to (40,50)Draws a diagonal line from (10,10) to (40,50)
8.Two Lines in a StackPanelTwo Lines in a StackPanel
9.Creates a blue line from point (30, 30) to point (180, 30):Creates a blue line from point (30, 30) to point (180, 30):
10.Creating LinesCreating Lines