Draw a Closed Shape Polygon in WPF using VB.NET

This article shows how to draw a closed shape by using the Polygon element.
  • 3609

This article shows how to draw a closed shape by using the Polygon element.

Polygon

The Polygon is the series of the lines that show a closed shape or, Any area bounded by a closed line or series of lines.

Important property

The below are the some important property of the Polygon.

Point property

Gets or sets a collection that contains the vertex points of the polygon.

For example

<Polygon Points="40,10 70,50 10,50" />

Stroke property

This property defines that how the Shape outline is painted.

<Polygon   Stroke="Red" .../>

Creating a Polygon in WPF

XAML code

<Polygon Stroke="Red"  StrokeThickness="2" Points="40,10 70,50 10,50" Width="86" Height="311" />

The width and height represents the width and height of the Polygon.

The Polygon looks like the below figure.

polygon1.gif

Figure1.gif

Using Fill property

This property is used to fill the interior shape of the Polygon.

Xaml code

<Polygon   Stroke="Red"  StrokeThickness="2" Points="40,10 70,50 10,50" Width="86" Height="311" />

 

The form looks like this.


polygon2.gif


Figure2.gif

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.