Working with Polygons


♣    To create any kind of polygon we can use below code

<polygon>……………</polygon>

♣    Polygon can be used to draw a line or triangle or rectangle or pentagon

<Window x:Class="LineWithPolygon.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Polygon Points="20,20 200,20" Stroke="Red" StrokeThickness="30"/>
    </Grid>
</Window>

Output :


wpf23