←Select platform

AnnCrossProductObject Class

Summary

Defines an annotation cross product object.

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.

Example

This example creates a cross product object.

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Demos; 
using Leadtools.Help; 
 
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)); 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
 
'''<!--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 
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Examples; 
//using Leadtools.Help; 
 
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)); 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
 
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 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.Annotations Assembly