XAML code for a simple polygon

Abhisek
Posted by Abhisek under WPF category on | Views : 4126
<Window x:Class="WpfApplication2.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Simple Polygon" Height="300" Width="300" Name="PolygonWindow">
<Grid>
<Canvas>
<Polygon Points="250,150 400,125 300,250 240,200"
Stroke="Purple" StrokeThickness="3" Width="623.458" Height="353.404" Canvas.Left="-175.035" Canvas.Top="-41.675" Name="Polygon">
<Polygon.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="Red" Offset="0" />
<GradientStop Color="Yellow" Offset="0.25" />
<GradientStop Color="Green" Offset="0.75" />
<GradientStop Color ="Blue" Offset="1" />
</LinearGradientBrush>
</Polygon.Fill>
</Polygon>
</Canvas>
</Grid>
</Window>

Comments or Responses

Login to post response