Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.10
|
Leadtools.Windows.Annotations Namespace : AnnRulerObject Class |
public class AnnRulerObject : AnnLineObject, IAnnFont, IAnnHeader, IAnnLine, IAnnObject, IAnnRuler
'Declaration Public Class AnnRulerObject Inherits AnnLineObject Implements IAnnFont, IAnnHeader, IAnnLine, IAnnObject, IAnnRuler
'Usage Dim instance As AnnRulerObject
public ref class AnnRulerObject : public AnnLineObject, IAnnFont, IAnnHeader, IAnnLine, IAnnObject, IAnnRuler
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.
This method creates a new ruler object that extends from 10.0, 4.5 to 20.56, 40.3 and is measured in inches.
Imports Leadtools.Windows.Controls Imports Leadtools.Windows.Annotations '''<!--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.Start = New Point(DirectCast(New LengthConverter().ConvertFrom("10in"), Double), _ DirectCast(New LengthConverter().ConvertFrom("4.5in"), Double)) ruler.End = New Point(DirectCast(New LengthConverter().ConvertFrom("20.56in"), Double), _ 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 = Colors.Red ruler.StrokeThickness = 4.0 container.Children.Add(ruler) End Sub
using Leadtools.Windows.Controls; using Leadtools.Windows.Annotations; using Leadtools.Demos; using Leadtools.Help; private void AnnRulerObject_AnnRulerObject(AnnContainer container) { AnnRulerObject ruler = new AnnRulerObject(); ruler.Start = new Point((double)new LengthConverter().ConvertFrom("10in"), (double)new LengthConverter().ConvertFrom("4.5in")); ruler.End = new Point((double)new LengthConverter().ConvertFrom("20.56in"), (double)new LengthConverter().ConvertFrom("40.3in")); ruler.Stroke = Colors.Red; 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.StrokeThickness = 4.0; container.Children.Add(ruler); }
using Leadtools.Windows.Controls; using Leadtools.Windows.Annotations; using Leadtools.Examples; private void AnnRulerObject_AnnRulerObject(AnnContainer container) { AnnRulerObject ruler = new AnnRulerObject(); ruler.Start = new Point(750, 337); ruler.End = new Point(1542, 3022); ruler.Stroke = Colors.Red; ruler.MeasurementUnit = AnnUnit.Pixel; ruler.TickMarksLength = 37; ruler.ShowTickMarks = true; ruler.GaugeLength = 75; ruler.ShowGauge = true; ruler.ShowLength = true; ruler.Precision = 2; ruler.StrokeThickness = 4.0; container.Children.Add(ruler); }
Imports Leadtools.Windows.Controls Imports Leadtools.Windows.Annotations Private Sub AnnRulerObject_AnnRulerObject(ByVal container As AnnContainer) Dim ruler As AnnRulerObject = New AnnRulerObject() ruler.Start = New Point(750, 337) ruler.End = New Point(1542, 3022) ruler.Stroke = Colors.Red ruler.MeasurementUnit = AnnUnit.Pixel ruler.TickMarksLength = 37 ruler.ShowTickMarks = True ruler.GaugeLength = 75 ruler.ShowGauge = True ruler.ShowLength = True ruler.Precision = 2 ruler.StrokeThickness = 4.0 container.Children.Add(ruler) End Sub
<Window x:Class="WPFSamples.AnnRulerObject" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Leadtools.Windows.Annotations" Height="600" Width="800" 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>