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





This class provides support for creating and managing Ruler annotation objects.

Object Model



Syntax

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

<AnnRulerObject .../>

XAML Object Element Usage 

<AnnRulerObject .../>

Example

This method creates a new ruler object that extends from 10.0, 4.5 to 20.56, 40.3 and is measured in inches.

Visual BasicCopy Code
'''<!--This method creates a new ruler object that extends from 10.0, 4.5 to 20.56, 40.3 and is measured in inches.-->
Private Sub AnnRulerObject_AnnRulerObject(ByVal container As AnnContainer)
   Dim ruler As AnnRulerObject = New AnnRulerObject()
   ruler.X1 = DirectCast(New LengthConverter().ConvertFrom("10in"), Double)
   ruler.Y1 = DirectCast(New LengthConverter().ConvertFrom("4.5in"), Double)
   ruler.X2 = DirectCast(New LengthConverter().ConvertFrom("20.56in"), Double)
   ruler.Y2 = DirectCast(New LengthConverter().ConvertFrom("40.3in"), Double)
   ruler.MeasurementUnit = AnnUnit.SmartEnglish
   ruler.TickMarksLength = DirectCast(New LengthConverter().ConvertFrom("0.5in"), Double)
   ruler.ShowTickMarks = True
   ruler.GaugeLength = DirectCast(New LengthConverter().ConvertFrom("1.0in"), Double)
   ruler.ShowGauge = True
   ruler.ShowLength = True
   ruler.Precision = 2
   ruler.Stroke = Brushes.Red
   ruler.StrokeThickness = 4.0
   container.Children.Add(ruler)
End Sub
C#Copy Code
private void AnnRulerObject_AnnRulerObject(AnnContainer container) 

   AnnRulerObject ruler = new AnnRulerObject(); 
   ruler.X1 = (double)new LengthConverter().ConvertFrom("10in"); 
   ruler.Y1 = (double)new LengthConverter().ConvertFrom("4.5in"); 
   ruler.X2 = (double)new LengthConverter().ConvertFrom("20.56in"); 
   ruler.Y2 = (double)new LengthConverter().ConvertFrom("40.3in"); 
   ruler.MeasurementUnit = AnnUnit.SmartEnglish; 
   ruler.TickMarksLength = (double)new LengthConverter().ConvertFrom("0.5in"); 
   ruler.ShowTickMarks = true; 
   ruler.GaugeLength = (double)new LengthConverter().ConvertFrom("1.0in"); 
   ruler.ShowGauge = true; 
   ruler.ShowLength = true; 
   ruler.Precision = 2; 
   ruler.Stroke = Brushes.Red; 
   ruler.StrokeThickness = 4.0; 
   container.Children.Add(ruler); 
}
XAMLCopy Code
<Window x:Class="WPFSamples.AnnRulerObject" Title="Leadtools.Windows.Annotations" Height="600" Width="800" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Annotations="clr-namespace:Leadtools.Windows.Annotations;assembly=Leadtools.Windows.Annotations"> 
  <Leadtools_Windows_Annotations:AnnRulerObject X1="10in" Y1="4.5in" X2="20.56in" Y2="40.3in" DpiX="0.0" DpiY="0.0" MeasurementUnit="SmartEnglish" TickMarksLength="0.5in" ShowTickMarks="True" GaugeLength="1.0in" ShowGauge="True" ShowLength="True" Precision="0" Stroke="Red" StrokeThickness="4.0" /> 
</Window>

Remarks

The annotation ruler object is characterized by starting and ending points, a stroke, a length, tick marks, and a gauge. For more information, refer to Using Rulers in WPF Annotation Objects.

For more information about the ruler annotation object refer to AnnRulerObject for WPF. For more information about the automated ruler 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.AnnLineObject
                        Leadtools.Windows.Annotations.AnnRulerObject

Requirements

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

See Also

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