LEADTOOLS Annotations (Leadtools.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
AnnPolyRulerObject Class
See Also  Members  
Leadtools.Annotations Namespace : AnnPolyRulerObject Class



The AnnPolyRulerObject Class is available in LEADTOOLS Document and Medical Imaging toolkits.

Defines an annotation polyruler object.

Object Model

AnnPolyRulerObject ClassAnnRectangle StructureAnnBrush ClassAnnContainer ClassAnnFont ClassAnnLength StructureAnnGroupObject ClassAnnFont ClassAnnPoint StructureAnnPoint StructureAnnPen ClassAnnPoint StructureAnnPoint StructureAnnLength StructureAnnUnitConverter Class

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class AnnPolyRulerObject 
   Inherits AnnPolylineObject
   Implements IAnnRulerObjectICloneableIDisposableISerializable 
Visual Basic (Usage)Copy Code
Dim instance As AnnPolyRulerObject
C++/CLI 
[SerializableAttribute()]
public ref class AnnPolyRulerObject : public AnnPolylineObject, IAnnRulerObjectICloneableIDisposableISerializable  

Example

This example creates a new polyruler.

Visual BasicCopy Code
Private Sub AnnPolyRulerObject_AnnPolyRulerObject(ByVal container As AnnContainer)
   Dim polyruler As AnnPolyRulerObject = New AnnPolyRulerObject()
   polyruler.MeasurementUnit = AnnUnit.SmartEnglish
   polyruler.TickMarksLength = New AnnLength(0.5F, AnnUnit.Inch)
   polyruler.ShowTickMarks = True
   polyruler.GaugeLength = New AnnLength(1.0F, AnnUnit.Inch)
   polyruler.ShowGauge = True
   polyruler.ShowLength = True
   polyruler.Precision = 2
   polyruler.Points.Add(New AnnPoint(100, 100, AnnUnit.Pixel))
   polyruler.Points.Add(New AnnPoint(200, 100, AnnUnit.Pixel))
   polyruler.Points.Add(New AnnPoint(200, 200, AnnUnit.Pixel))
   polyruler.Points.Add(New AnnPoint(100, 300, AnnUnit.Pixel))
   polyruler.Pen = New AnnPen(Color.Red, New AnnLength(1, AnnUnit.Pixel))
   container.Objects.Add(polyruler)
End Sub
C#Copy Code
private void AnnPolyRulerObject_AnnPolyRulerObject(AnnContainer container)
{
   AnnPolyRulerObject polyruler = new AnnPolyRulerObject();
   polyruler.MeasurementUnit = AnnUnit.SmartEnglish;
   polyruler.TickMarksLength = new AnnLength(0.5F, AnnUnit.Inch);
   polyruler.ShowTickMarks = true;
   polyruler.GaugeLength = new AnnLength(1.0F, AnnUnit.Inch);
   polyruler.ShowGauge = true;
   polyruler.ShowLength = true;
   polyruler.Precision = 2;
   polyruler.Points.Add(new AnnPoint(100, 100, AnnUnit.Pixel));
   polyruler.Points.Add(new AnnPoint(200, 100, AnnUnit.Pixel));
   polyruler.Points.Add(new AnnPoint(200, 200, AnnUnit.Pixel));
   polyruler.Points.Add(new AnnPoint(100, 300, AnnUnit.Pixel));
   polyruler.Pen = new AnnPen(Color.Red, new AnnLength(1, AnnUnit.Pixel));
   container.Objects.Add(polyruler);
}

Remarks

The polyruler annotation object is an array of points that create a sequence of joined rulers. The polyruler can be used to measure the distance of an irregularly shaped object. As ruler segments are added, removed, or changed in length, a running total of the total distance is displayed.
For more information, refer to Using Rulers in Annotation Objects.

For more information about the polyruler annotation object refer to AnnPolyrulerObject. For more information about the automated polyruler annotation object, refer to Annotation Objects - Automated Features and Automated Annotations - Ruler Tab.

Inheritance Hierarchy

System.Object
   Leadtools.Annotations.AnnDrawable
      Leadtools.Annotations.AnnObject
         Leadtools.Annotations.AnnPolylineObject
            Leadtools.Annotations.AnnPolyRulerObject

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features