AnnPolylineObject Class (original) (raw)
Summary
Defines an annotation polyline object.
Syntax
C#
Objective-C
C++/CLI
Java
Python
@interface LTAnnPolylineObject : LTAnnObject<NSCoding, NSCopying>
public class AnnPolylineObject extends AnnObject
public:
ref class AnnPolylineObject : [AnnObject](annobject.html)
class AnnPolylineObject(AnnObject):
Example
This example creates a polyline object and adds it to the automation container.
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
using Leadtools.Codecs;
using Leadtools.Annotations;
using Leadtools.Annotations.WinForms;
public void AnnCore_AnnPolylineObject()
{
// assumes _automation is valid
double inch = 720.0;
// Add a freehand hotspot object
AnnPolylineObject polyLineObj = new AnnPolylineObject();
// Set the points for the freehand hotspot
polyLineObj.Points.Add(LeadPointD.Create(1 * inch, 1 * inch));
polyLineObj.Points.Add(LeadPointD.Create(2 * inch, 2 * inch));
polyLineObj.Points.Add(LeadPointD.Create(1 * inch, 5 * inch));
polyLineObj.Points.Add(LeadPointD.Create(5 * inch, 5 * inch));
polyLineObj.Points.Add(LeadPointD.Create(4 * inch, 2 * inch));
polyLineObj.Points.Add(LeadPointD.Create(5 * inch, 1 * inch));
// Set the stroke
polyLineObj.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Red"), LeadLengthD.Create(3));
// Set the fill
polyLineObj.Fill = AnnSolidColorBrush.Create("Green");
// Set the figure to closed
polyLineObj.IsClosed = true;
// Add the object to the automation container
_automation.Container.Children.Add(polyLineObj);
}