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
AnnProtractorObject Class
See Also  Members  
Leadtools.Windows.Annotations Namespace : AnnProtractorObject Class



The AnnProtractorObject Class supports WPF/Silverlight.

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

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

Object Model

AnnProtractorObject Class

Syntax

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

Example

This example creates a new protractor object.

Visual BasicCopy Code
'''<!--This example creates a new protractor object.-->
Private Sub AnnProtractorObject_AnnProtractorObject(ByVal container As AnnContainer)
   Dim protractor As AnnProtractorObject = New AnnProtractorObject()
   protractor.Stroke = Colors.Green
   protractor.StrokeThickness = 3.0
   protractor.CenterPoint = New System.Windows.Point(DirectCast(New LengthConverter().ConvertFrom("10.0in"), Double), DirectCast(New LengthConverter().ConvertFrom("4.5in"), Double))
   protractor.FirstPoint = New System.Windows.Point(DirectCast(New LengthConverter().ConvertFrom("5.0in"), Double), DirectCast(New LengthConverter().ConvertFrom("20.0in"), Double))
   protractor.SecondPoint = New System.Windows.Point(DirectCast(New LengthConverter().ConvertFrom("20.56in"), Double), DirectCast(New LengthConverter().ConvertFrom("40.3in"), Double))
   protractor.MeasurementUnit = AnnUnit.SmartEnglish
   protractor.TickMarksLength = DirectCast(New LengthConverter().ConvertFrom("0.5in"), Double)
   protractor.ShowTickMarks = True
   protractor.GaugeLength = DirectCast(New LengthConverter().ConvertFrom("1.0in"), Double)
   protractor.ShowGauge = True
   protractor.ShowLength = True
   protractor.Precision = 2
   protractor.AngularUnit = AnnAngularUnit.Degree
   protractor.Acute = True
   protractor.AnglePrecision = 2
   protractor.ArcRadius = DirectCast(New LengthConverter().ConvertFrom("0.5in"), Double)
   container.Children.Add(protractor)
End Sub
C#Copy Code
private void AnnProtractorObject_AnnProtractorObject(AnnContainer container)
{
   AnnProtractorObject protractor = new AnnProtractorObject();
   protractor.Stroke = Colors.Green;
   protractor.StrokeThickness = 3.0;
   protractor.CenterPoint = new Point((double)new LengthConverter().ConvertFrom("10.0in"), (double)new LengthConverter().ConvertFrom("4.5in"));
   protractor.FirstPoint = new Point((double)new LengthConverter().ConvertFrom("5.0in"), (double)new LengthConverter().ConvertFrom("20.0in"));
   protractor.SecondPoint = new Point((double)new LengthConverter().ConvertFrom("20.56in"), (double)new LengthConverter().ConvertFrom("40.3in"));
   protractor.MeasurementUnit = AnnUnit.SmartEnglish;
   protractor.TickMarksLength = (double)new LengthConverter().ConvertFrom("0.5in");
   protractor.ShowTickMarks = true;
   protractor.GaugeLength = (double)new LengthConverter().ConvertFrom("1.0in");
   protractor.ShowGauge = true;
   protractor.ShowLength = true;
   protractor.Precision = 2;
   protractor.AngularUnit = AnnAngularUnit.Degree;
   protractor.Acute = true;
   protractor.AnglePrecision = 2;
   protractor.ArcRadius = (double)new LengthConverter().ConvertFrom("0.5in");
   container.Children.Add(protractor);
}
SilverlightCSharpCopy Code
private void AnnProtractorObject_AnnProtractorObject(AnnContainer container)
{
   AnnProtractorObject protractor = new AnnProtractorObject();
   protractor.Stroke = Colors.Green;
   protractor.StrokeThickness = 3.0;
   protractor.CenterPoint = new Point(750, 337);
   protractor.FirstPoint = new Point(375, 1500);
   protractor.SecondPoint = new Point(1542, 3022);
   protractor.MeasurementUnit = AnnUnit.Pixel;
   protractor.TickMarksLength = 37;
   protractor.ShowTickMarks = true;
   protractor.GaugeLength = 75;
   protractor.ShowGauge = true;
   protractor.ShowLength = true;
   protractor.Precision = 2;
   protractor.AngularUnit = AnnAngularUnit.Degree;
   protractor.Acute = true;
   protractor.AnglePrecision = 2;
   protractor.ArcRadius = 37;
   container.Children.Add(protractor);
}
SilverlightVBCopy Code
Private Sub AnnProtractorObject_AnnProtractorObject(ByVal container As AnnContainer)
   Dim protractor As AnnProtractorObject = New AnnProtractorObject()
   protractor.Stroke = Colors.Green
   protractor.StrokeThickness = 3.0
   protractor.CenterPoint = New Point(750, 337)
   protractor.FirstPoint = New Point(375, 1500)
   protractor.SecondPoint = New Point(1542, 3022)
   protractor.MeasurementUnit = AnnUnit.Pixel
   protractor.TickMarksLength = 37
   protractor.ShowTickMarks = True
   protractor.GaugeLength = 75
   protractor.ShowGauge = True
   protractor.ShowLength = True
   protractor.Precision = 2
   protractor.AngularUnit = AnnAngularUnit.Degree
   protractor.Acute = True
   protractor.AnglePrecision = 2
   protractor.ArcRadius = 37
   container.Children.Add(protractor)
End Sub
XAMLCopy Code
<Window x:Class="WPFSamples.AnnProtractorObject" 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:AnnProtractorObject CenterPoint="10.0in,4.5in" FirstPoint="5.0in,20.0in" SecondPoint="20.56in,40.3in" MeasurementUnit="SmartEnglish" TickMarksLength="0.5in" ShowTickMarks="True" GaugeLength="1.0in" ShowGauge="True" ShowLength="True" Precision="2" AngularUnit="AnnAngularUnit.Degree" Acute="true" AnglePrecision="2" ArcRadius="0.5in" Stroke="Green" StrokeThickness="3.0" />
</Window>

Remarks

The protractor annotation object consists of two rulers joined at a point to create an angle. The center point is CenterPoint, the first line ends at FirstPoint and the second point ends at SecondPoint.
For more information, refer to Using Protractors in WPF Annotation Objects.

For more information about the protractor annotation object refer to AnnProtractorObject for WPF. For more information about the automated protractor clip annotation object, refer to WPF Annotation Objects - Automated Features and WPF Automated Annotations - Protractor Tab.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         Leadtools.Windows.Annotations.AnnObject
            Leadtools.Windows.Annotations.AnnProtractorObject

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

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