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



The AnnPolyRulerObject Class supports WPF/Silverlight.

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

Defines an annotation polyruler object. Supported in Silverlight, Windows Phone 7

Object Model

AnnPolyRulerObject Class

Syntax

Visual Basic (Declaration) 
Public Class AnnPolyRulerObject 
   Inherits AnnPolylineObject
   Implements IAnnHeaderIAnnObjectIAnnPolylineIAnnRuler 
Visual Basic (Usage)Copy Code
Dim instance As AnnPolyRulerObject
C# 
public class AnnPolyRulerObject : AnnPolylineObject, IAnnHeaderIAnnObjectIAnnPolylineIAnnRuler  
C++/CLI 
public ref class AnnPolyRulerObject : public AnnPolylineObject, IAnnHeaderIAnnObjectIAnnPolylineIAnnRuler  

Example

This example creates a new polyruler.

Visual BasicCopy Code
'''<!--This example creates a new polyruler.-->
Private Sub AnnPolyRulerObject_AnnPolyRulerObject(ByVal container As AnnContainer)
   Dim polyruler As AnnPolyRulerObject = New AnnPolyRulerObject()
   polyruler.MeasurementUnit = AnnUnit.SmartEnglish
   polyruler.TickMarksLength = DirectCast(New LengthConverter().ConvertFrom("0.5in"), Double)
   polyruler.ShowTickMarks = True
   polyruler.GaugeLength = DirectCast(New LengthConverter().ConvertFrom("1.0in"), Double)
   polyruler.ShowGauge = True
   polyruler.ShowLength = True
   polyruler.Precision = 2
   polyruler.Points.Add(New System.Windows.Point(100, 100))
   polyruler.Points.Add(New System.Windows.Point(200, 100))
   polyruler.Points.Add(New System.Windows.Point(200, 200))
   polyruler.Points.Add(New System.Windows.Point(100, 300))
   polyruler.Stroke = Colors.Red
   polyruler.StrokeThickness = 1.0
   container.Children.Add(polyruler)
End Sub
C#Copy Code
private void AnnPolyRulerObject_AnnPolyRulerObject(AnnContainer container)
{
   AnnPolyRulerObject polyruler = new AnnPolyRulerObject();
   polyruler.MeasurementUnit = AnnUnit.SmartEnglish;
   polyruler.TickMarksLength = (double)new LengthConverter().ConvertFrom("0.5in");
   polyruler.ShowTickMarks = true;
   polyruler.GaugeLength = (double)new LengthConverter().ConvertFrom("1.0in");
   polyruler.ShowGauge = true;
   polyruler.ShowLength = true;
   polyruler.Precision = 2;
   polyruler.Points.Add(new Point(100, 100));
   polyruler.Points.Add(new Point(200, 100));
   polyruler.Points.Add(new Point(200, 200));
   polyruler.Points.Add(new Point(100, 300));
   polyruler.Stroke = Colors.Red;
   polyruler.StrokeThickness = 1.0;
   container.Children.Add(polyruler);
}
SilverlightCSharpCopy Code
private void AnnPolyRulerObject_AnnPolyRulerObject(AnnContainer container)
{
   AnnPolyRulerObject polyruler = new AnnPolyRulerObject();
   polyruler.MeasurementUnit = AnnUnit.Pixel;
   polyruler.TickMarksLength = 37;
   polyruler.ShowTickMarks = true;
   polyruler.GaugeLength = 75;
   polyruler.ShowGauge = true;
   polyruler.ShowLength = true;
   polyruler.Precision = 2;
   polyruler.Points.Add(new Point(100, 100));
   polyruler.Points.Add(new Point(200, 100));
   polyruler.Points.Add(new Point(200, 200));
   polyruler.Points.Add(new Point(100, 300));
   polyruler.Stroke = Colors.Red;
   polyruler.StrokeThickness = 1.0;
   container.Children.Add(polyruler);
}
SilverlightVBCopy Code
Private Sub AnnPolyRulerObject_AnnPolyRulerObject(ByVal container As AnnContainer)
   Dim polyruler As AnnPolyRulerObject = New AnnPolyRulerObject()
   polyruler.MeasurementUnit = AnnUnit.Pixel
   polyruler.TickMarksLength = 37
   polyruler.ShowTickMarks = True
   polyruler.GaugeLength = 75
   polyruler.ShowGauge = True
   polyruler.ShowLength = True
   polyruler.Precision = 2
   polyruler.Points.Add(New Point(100, 100))
   polyruler.Points.Add(New Point(200, 100))
   polyruler.Points.Add(New Point(200, 200))
   polyruler.Points.Add(New Point(100, 300))
   polyruler.Stroke = Colors.Red
   polyruler.StrokeThickness = 1.0
   container.Children.Add(polyruler)
End Sub

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 WPF Annotation Objects.

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

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         Leadtools.Windows.Annotations.AnnObject
            Leadtools.Windows.Annotations.AnnPolylineObject
               Leadtools.Windows.Annotations.AnnPolyRulerObject

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also

AnnPolyRulerObject requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.