Defines an annotation polygon object.
Object Model
Syntax
XAML Object Element Usage | |
---|
<AnnPolygonObject .../> |
XAML Object Element Usage | |
---|
<AnnPolygonObject .../> |
Example
This example creates a new closed polygon object with 4 points.
Visual Basic | Copy Code |
---|
Private Sub AnnPolygonObject_AnnPolygonObject(ByVal container As AnnContainer)
Dim polygon As AnnPolygonObject = New AnnPolygonObject()
polygon.Points.Add(New System.Windows.Point(100, 100))
polygon.Points.Add(New System.Windows.Point(200, 100))
polygon.Points.Add(New System.Windows.Point(200, 200))
polygon.Points.Add(New System.Windows.Point(100, 300))
polygon.Stroke = Brushes.Red
polygon.StrokeThickness = 1.0
polygon.Fill = Brushes.White
polygon.FillRule = FillRule.EvenOdd
polygon.IsClosed = True
container.Children.Add(polygon)
End Sub |
C# | Copy Code |
---|
private void AnnPolygonObject_AnnPolygonObject(AnnContainer container) { AnnPolygonObject polygon = new AnnPolygonObject(); polygon.Points.Add(new Point(100, 100)); polygon.Points.Add(new Point(200, 100)); polygon.Points.Add(new Point(200, 200)); polygon.Points.Add(new Point(100, 300)); polygon.Stroke = Brushes.Red; polygon.StrokeThickness = 1.0; polygon.Fill = Brushes.White; polygon.FillRule = FillRule.EvenOdd; polygon.IsClosed = true; container.Children.Add(polygon); } |
XAML | Copy Code |
---|
<Window x:Class="WPFSamples.AnnPolygonObject" Title="Leadtools.Windows.Annotations" Height="600" Width="800" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Annotations="clr-namespace:Leadtools.Windows.Annotations;assembly=Leadtools.Windows.Annotations"> <Leadtools_Windows_Annotations:AnnContainer Width="400" Height="400" Background="Yellow"> <Leadtools_Windows_Annotations:AnnPolygonObject Points="100,100 175, 125, 25,150 175,175 100,200" IsClosed="True" FillRule="EvenOdd" Fill="Green" Stroke="Blue" StrokeThickness="8.0" StrokeDashArray="1.5, 1.5" StrokeDashOffset="2.0" StrokeDashCap="Round" StrokeStartLineCap="Round" StrokeLineJoin="Round" StrokeEndLineCap="Round" StrokeMiterLimit="10" Header="Polygon Object" HeaderOffset="-10, -10" HeaderBackground="Red" HeaderForeground="Green" HeaderFontFamily="Agency FB" HeaderFontStyle="Italic" HeaderFontWeight="Bold" HeaderFontStretch="Normal" HeaderFontSize="20" HeaderDecorations="Strikethrough" IsHeaderVisible="True" IsHeaderRestricted="True"></Leadtools_Windows_Annotations:AnnPolygonObject> </Leadtools_Windows_Annotations:AnnContainer> </Window> |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also