Leadtools.Windows.Annotations Requires Document/Medical license. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AnnPolyRulerObject Class
See Also  Members   Example 
Leadtools.Windows.Annotations Namespace : AnnPolyRulerObject Class





Defines an annotation polyruler object.

Object Model



Syntax

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

<AnnPolyRulerObject .../>

XAML Object Element Usage 

<AnnPolyRulerObject .../>

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 = Brushes.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 = Brushes.Red; 
   polyruler.StrokeThickness = 1.0; 
   container.Children.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 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
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  Leadtools.Windows.Annotations.AnnObjectBase
                     Leadtools.Windows.Annotations.AnnPolylineObject
                        Leadtools.Windows.Annotations.AnnPolyRulerObject

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

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.