LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly)
LEAD Technologies, Inc

AnnPolyRulerObject Class

Example 





Members 
Defines an annotation polyruler object. .NET support Silverlight support
Object Model
AnnPolyRulerObject ClassAnnBrush ClassAnnBrush Class
Syntax
public class AnnPolyRulerObject : AnnPolylineObject, IAnnFontIAnnHeaderIAnnObjectIAnnPolylineIAnnRuler  
'Declaration
 
Public Class AnnPolyRulerObject 
   Inherits AnnPolylineObject
   Implements IAnnFontIAnnHeaderIAnnObjectIAnnPolylineIAnnRuler 
'Usage
 
Dim instance As AnnPolyRulerObject
public sealed class AnnPolyRulerObject : IAnnFontIAnnHeaderIAnnObjectIAnnPolylineIAnnRuler  
function Leadtools.Windows.Annotations.AnnPolyRulerObject()
public ref class AnnPolyRulerObject : public AnnPolylineObject, IAnnFontIAnnHeaderIAnnObjectIAnnPolylineIAnnRuler  
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.

Example
Copy CodeCopy 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
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);
}
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);
}
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
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnPolyRulerObject Members
Leadtools.Windows.Annotations Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.