Defines an annotation polygon object.
public class AnnPolygonObject : Leadtools.Windows.Annotations.AnnPolylineObject, Leadtools.Windows.Annotations.IAnnHeader, Leadtools.Windows.Annotations.IAnnObject, Leadtools.Windows.Annotations.IAnnPolygon, Leadtools.Windows.Annotations.IAnnPolyline
Public Class AnnPolygonObject
Inherits Leadtools.Windows.Annotations.AnnPolylineObject
Implements Leadtools.Windows.Annotations.IAnnHeader, Leadtools.Windows.Annotations.IAnnObject, Leadtools.Windows.Annotations.IAnnPolygon, Leadtools.Windows.Annotations.IAnnPolyline
The polygon object is a simple polygon that contains a collection of System.Windows.Point points, a stroke and a fill. The polygon can be IsClosed or not, and can also have a certain FillRule. For an illustration of the different fill modes, refer to FillRule enumeration.
For more information about the polygon annotation object refer to AnnPolygonObject for WPF. For more information about the automated polygon annotation object, refer to WPF Annotation Objects - Automated Features.
This example creates a new closed polygon object with 4 points.
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
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 = Colors.Red
polygon.StrokeThickness = 1.0
polygon.Fill = Colors.White
polygon.FillRule = AnnFillRule.EvenOdd
polygon.IsClosed = True
container.Children.Add(polygon)
End Sub
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Demos;
using Leadtools.Help;
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 = Colors.Red;
polygon.Fill = Colors.White;
polygon.FillRule = AnnFillRule.EvenOdd;
polygon.StrokeThickness = 1.0;
polygon.IsClosed = true;
container.Children.Add(polygon);
}
using Leadtools.Windows.Controls;
using Leadtools.Windows.Annotations;
using Leadtools.Examples;
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 = Colors.Red;
polygon.Fill = Colors.White;
polygon.FillRule = AnnFillRule.EvenOdd;
polygon.StrokeThickness = 1.0;
polygon.IsClosed = true;
container.Children.Add(polygon);
}
Imports Leadtools.Windows.Controls
Imports Leadtools.Windows.Annotations
Private Sub AnnPolygonObject_AnnPolygonObject(ByVal container As AnnContainer)
Dim polygon As AnnPolygonObject = 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 = Colors.Red
polygon.Fill = Colors.White
polygon.FillRule = AnnFillRule.EvenOdd
polygon.StrokeThickness = 1.0
polygon.IsClosed = True
container.Children.Add(polygon)
End Sub
<Window x:Class="WPFSamples.AnnPolygonObject"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Leadtools.Windows.Annotations" Height="600" Width="800"
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>
Products |
Support |
Feedback: AnnPolygonObject Class - Leadtools.Windows.Annotations |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.