←Select platform

AnnLineEnding Class

Summary

Defines the base class for all line ending styles.

Syntax
C#
C++/CLI
Python
public abstract class AnnLineEnding 
public: 
   ref class AnnLineEnding abstract 
class AnnLineEnding: 

Remarks The line ending styles are the shapes that can be added to the start and end of the polyline object. The following ending styles are supported:

annlineendings.png

The AnnLineEnding class provides all the basic functionality common to all LEADTOOLS line ending styles. AnnLineEnding is an abstract class and cannot be instantiated directly. Instead, you create an instance of a derived class such as AnnArrowLineEnding or AnnButtLineEnding and use the methods and properties of the base AnnLineEnding through the derived class.

The line ending styles cannot be added to closed polyline objects.

Example

This example creates a list of polyline objects, all ending style types, and sets them to polyline objects ending styles.

C#
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Engine; 
using Leadtools.Codecs; 
using Leadtools.Annotations; 
using Leadtools.Annotations.WinForms; 
 
public void AnnCore_AnnLineEnding() 
{ 
   // assumes _automation is valid 
 
 
   double inch = 720.0; 
 
   // Create polyline object and add it the automation container   
   AnnPolylineObject polyLine = new AnnPolylineObject(); 
   polyLine.Points.Add(LeadPointD.Create(1 * inch, 1 * inch)); 
   polyLine.Points.Add(LeadPointD.Create(2 * inch, 1 * inch)); 
   _automation.Container.Children.Add(polyLine); 
 
 
   // Create arrow line ending style and set some properties 
   AnnArrowLineEnding arrowStyle = new AnnArrowLineEnding(); 
   arrowStyle.Closed = true; 
   arrowStyle.Reversed = true; 
   arrowStyle.Fill = AnnSolidColorBrush.Create("Yellow"); 
   // Set the the created arrow style to polyline start and end style 
   polyLine.StartStyle = arrowStyle; 
   polyLine.EndStyle = arrowStyle; 
 
   // Previewing start and end line styles 
   AnnLineEnding annLineStart = polyLine.StartStyle; 
   AnnLineEnding annLineEnding = polyLine.EndStyle; 
   Debug.WriteLine($"Line start style: {annLineStart.FriendlyName } | Line end style: {annLineEnding.FriendlyName}"); 
 
   // Create another polyline object and add it the automation container   
   polyLine = new AnnPolylineObject(); 
   polyLine.Points.Add(LeadPointD.Create(1 * inch, 1.2 * inch)); 
   polyLine.Points.Add(LeadPointD.Create(2 * inch, 1.2 * inch)); 
   _automation.Container.Children.Add(polyLine); 
   // Create butt line ending style 
   AnnButtLineEnding buttStyle = new AnnButtLineEnding(); 
   // Set the the created butt style to polyline start and end style 
   polyLine.StartStyle = buttStyle; 
   polyLine.EndStyle = buttStyle; 
 
 
   // Create another polyline object and add it the automation container   
   polyLine = new AnnPolylineObject(); 
   polyLine.Points.Add(LeadPointD.Create(1 * inch, 1.4 * inch)); 
   polyLine.Points.Add(LeadPointD.Create(2 * inch, 1.4 * inch)); 
   _automation.Container.Children.Add(polyLine); 
   // Create slash line ending style 
   AnnSlashLineEnding slashStyle = new AnnSlashLineEnding(); 
   // Set the the created slash style to polyline start and end style 
   polyLine.StartStyle = slashStyle; 
   polyLine.EndStyle = slashStyle; 
 
 
   // Create another polyline object and add it the automation container   
   polyLine = new AnnPolylineObject(); 
   polyLine.Points.Add(LeadPointD.Create(1 * inch, 1.6 * inch)); 
   polyLine.Points.Add(LeadPointD.Create(2 * inch, 1.6 * inch)); 
   _automation.Container.Children.Add(polyLine); 
   // Create square line ending style 
   AnnSquareLineEnding squareStyle = new AnnSquareLineEnding(); 
   // Set the the created square style to polyline start and end style 
   polyLine.StartStyle = squareStyle; 
   polyLine.EndStyle = squareStyle; 
 
 
   // Create another polyline object and add it the automation container   
   polyLine = new AnnPolylineObject(); 
   polyLine.Points.Add(LeadPointD.Create(1 * inch, 1.8 * inch)); 
   polyLine.Points.Add(LeadPointD.Create(2 * inch, 1.8 * inch)); 
   _automation.Container.Children.Add(polyLine); 
   // Create diamond line ending style 
   AnnDiamondLineEnding diamondStyle = new AnnDiamondLineEnding(); 
   // Set the the created diamond style to polyline start and end style 
   polyLine.StartStyle = diamondStyle; 
   polyLine.EndStyle = diamondStyle; 
 
 
   // Create another polyline object and add it the automation container   
   polyLine = new AnnPolylineObject(); 
   polyLine.Points.Add(LeadPointD.Create(1 * inch, 2 * inch)); 
   polyLine.Points.Add(LeadPointD.Create(2 * inch, 2 * inch)); 
   _automation.Container.Children.Add(polyLine); 
   // Create round line ending style 
   AnnRoundLineEnding roundStyle = new AnnRoundLineEnding(); 
   // Set the the created round style to polyline start and end style 
   polyLine.StartStyle = roundStyle; 
   polyLine.EndStyle = roundStyle; 
 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.