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



The AnnCrossProductObject Class supports WPF/Silverlight.

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

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

Object Model

AnnCrossProductObject Class

Syntax

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

Example

This example creates a cross product object.

Visual BasicCopy Code
'''<!--This example creates a cross product object.-->
Private Sub AnnCrossProductObject_AnnCrossProductObject(ByVal container As AnnContainer)
   Dim crossProduct As AnnCrossProductObject = New AnnCrossProductObject()
   crossProduct.Stroke = Colors.Red
   crossProduct.StrokeThickness = 1.0
   crossProduct.FontFamilyName = "Arial"
   crossProduct.FontSize = 10.0
   crossProduct.FirstStartPoint = New System.Windows.Point(DirectCast(New LengthConverter().ConvertFrom("5in"), Double), DirectCast(New LengthConverter().ConvertFrom("5in"), Double))
   crossProduct.FirstEndPoint = New System.Windows.Point(DirectCast(New LengthConverter().ConvertFrom("10in"), Double), DirectCast(New LengthConverter().ConvertFrom("10in"), Double))
   ' make this cross product symmetrical
   crossProduct.UpdateSecondPoints()
   ' update the intersection point
   crossProduct.UpdateIntersectionPoint()
   crossProduct.MeasurementUnit = AnnUnit.Inch
   crossProduct.TickMarksLength = DirectCast(New LengthConverter().ConvertFrom("0.25in"), Double)
   crossProduct.ShowTickMarks = True
   crossProduct.GaugeLength = DirectCast(New LengthConverter().ConvertFrom("1.0in"), Double)
   crossProduct.ShowGauge = True
   crossProduct.ShowLength = True
   crossProduct.Precision = 2
   container.Children.Add(crossProduct)

   ' show the intersection point
   MessageBox.Show(String.Format("Intersection point is at: {0}", crossProduct.IntersectionPoint))
End Sub
C#Copy Code
private void AnnCrossProductObject_AnnCrossProductObject(AnnContainer container)
{
   AnnCrossProductObject crossProduct = new AnnCrossProductObject();
   crossProduct.Stroke = Colors.Red;
   crossProduct.FontFamilyName = "Arial";
   crossProduct.StrokeThickness = 1.0;
   crossProduct.FontSize = 10.0;
   crossProduct.FirstStartPoint = new Point((double)new LengthConverter().ConvertFrom("5in"), (double)new LengthConverter().ConvertFrom("5in"));
   crossProduct.FirstEndPoint = new Point((double)new LengthConverter().ConvertFrom("10in"), (double)new LengthConverter().ConvertFrom("10in"));
   // make this cross product symmetrical
   crossProduct.UpdateSecondPoints();
   // update the intersection point
   crossProduct.UpdateIntersectionPoint();
   crossProduct.MeasurementUnit = AnnUnit.Inch;
   crossProduct.TickMarksLength = (double)new LengthConverter().ConvertFrom("0.25in");
   crossProduct.ShowTickMarks = true;
   crossProduct.GaugeLength = (double)new LengthConverter().ConvertFrom("1.0in");
   crossProduct.ShowGauge = true;
   crossProduct.ShowLength = true;
   crossProduct.Precision = 2;
   container.Children.Add(crossProduct);

   // show the intersection point
   MessageBox.Show(String.Format("Intersection point is at: {0}", crossProduct.IntersectionPoint));
}
SilverlightCSharpCopy Code
private void AnnCrossProductObject_AnnCrossProductObject(AnnContainer container)
{
   AnnCrossProductObject crossProduct = new AnnCrossProductObject();
   crossProduct.Stroke = Colors.Red;
   crossProduct.FontFamilyName = "Arial";
   crossProduct.StrokeThickness = 1.0;
   crossProduct.FontSize = 10.0;
   crossProduct.FirstStartPoint = new Point(375, 375);
   crossProduct.FirstEndPoint = new Point(750, 750);
   // make this cross product symmetrical
   crossProduct.UpdateSecondPoints();
   // update the intersection point
   crossProduct.UpdateIntersectionPoint();
   crossProduct.MeasurementUnit = AnnUnit.Pixel;
   crossProduct.TickMarksLength = 18;
   crossProduct.ShowTickMarks = true;
   crossProduct.GaugeLength = 75;
   crossProduct.ShowGauge = true;
   crossProduct.ShowLength = true;
   crossProduct.Precision = 2;
   container.Children.Add(crossProduct);

   // show the intersection point
   MessageBox.Show(String.Format("Intersection point is at: {0}", crossProduct.IntersectionPoint));
}
SilverlightVBCopy Code
Private Sub AnnCrossProductObject_AnnCrossProductObject(ByVal container As AnnContainer)
   Dim crossProduct As AnnCrossProductObject = New AnnCrossProductObject()
   crossProduct.Stroke = Colors.Red
   crossProduct.FontFamilyName = "Arial"
   crossProduct.StrokeThickness = 1.0
   crossProduct.FontSize = 10.0
   crossProduct.FirstStartPoint = New Point(375, 375)
   crossProduct.FirstEndPoint = New Point(750, 750)
   ' make this cross product symmetrical
   crossProduct.UpdateSecondPoints()
   ' update the intersection point
   crossProduct.UpdateIntersectionPoint()
   crossProduct.MeasurementUnit = AnnUnit.Pixel
   crossProduct.TickMarksLength = 18
   crossProduct.ShowTickMarks = True
   crossProduct.GaugeLength = 75
   crossProduct.ShowGauge = True
   crossProduct.ShowLength = True
   crossProduct.Precision = 2
   container.Children.Add(crossProduct)

   ' show the intersection point
   MessageBox.Show(String.Format("Intersection point is at: {0}", crossProduct.IntersectionPoint))
End Sub
XAMLCopy Code
<Window x:Class="WPFSamples.AnnCrossProductObject" 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:AnnCrossProductObject FirstStartPoint="5in,5in" FirstEndPoint="10in,5in" SecondStartPoint="7.5in,2.5in" SecondEndPoint="7.5in,7.5in" IntersectionPoint="7.5in,5in" MeasurementUnit="Inch" TickMarksLength="0.25in" ShowTickMarks="True" GaugeLength="1.0in" ShowGauge="True" ShowLength="True" Precision="0" Stroke="Red" StrokeThickness="1.0" FontFamily="Arial" FontSize="10.0" />
</Window>

Remarks

The cross-product annotation object consists of two rulers intersecting at right angles. The intersection point of a cross product object updates dynamically and can be obtained through the IntersectionPoint property.

For more information about the crossproduct annotation object refer to AnnCrossProductObject for WPF. For more information about the automated crossproduct annotation object, refer to WPF Annotation Objects - Automated Features.

Inheritance Hierarchy

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

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

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