ARTICLE

How to draw a closed shape polygon in WPF using VB.NET

Posted by Rohatash Kumar Articles | XAML in VB.NET March 22, 2011
This article shows how to draw a closed shape by using the Polygon element.
 
Reader Level:

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

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Nevron Diagram
Become a Sponsor