Defines an annotation polyruler object.
Object Model
Syntax
XAML Object Element Usage | |
---|
<AnnPolyRulerObject .../> |
XAML Object Element Usage | |
---|
<AnnPolyRulerObject .../> |
Example
This example creates a new polyruler.
Visual Basic | Copy Code |
---|
Private Sub AnnPolyRulerObject_AnnPolyRulerObject(ByVal container As AnnContainer)
Dim polyruler As AnnPolyRulerObject = New AnnPolyRulerObject()
polyruler.MeasurementUnit = AnnUnit.SmartEnglish
polyruler.TickMarksLength = DirectCast(New LengthConverter().ConvertFrom("0.5in"), Double)
polyruler.ShowTickMarks = True
polyruler.GaugeLength = DirectCast(New LengthConverter().ConvertFrom("1.0in"), Double)
polyruler.ShowGauge = True
polyruler.ShowLength = True
polyruler.Precision = 2
polyruler.Points.Add(New System.Windows.Point(100, 100))
polyruler.Points.Add(New System.Windows.Point(200, 100))
polyruler.Points.Add(New System.Windows.Point(200, 200))
polyruler.Points.Add(New System.Windows.Point(100, 300))
polyruler.Stroke = Brushes.Red
polyruler.StrokeThickness = 1.0
container.Children.Add(polyruler)
End Sub
|
C# | Copy Code |
---|
private void AnnPolyRulerObject_AnnPolyRulerObject(AnnContainer container) { AnnPolyRulerObject polyruler = new AnnPolyRulerObject(); polyruler.MeasurementUnit = AnnUnit.SmartEnglish; polyruler.TickMarksLength = (double)new LengthConverter().ConvertFrom("0.5in"); polyruler.ShowTickMarks = true; polyruler.GaugeLength = (double)new LengthConverter().ConvertFrom("1.0in"); polyruler.ShowGauge = true; polyruler.ShowLength = true; polyruler.Precision = 2; polyruler.Points.Add(new Point(100, 100)); polyruler.Points.Add(new Point(200, 100)); polyruler.Points.Add(new Point(200, 200)); polyruler.Points.Add(new Point(100, 300)); polyruler.Stroke = Brushes.Red; polyruler.StrokeThickness = 1.0; container.Children.Add(polyruler); } |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family
See Also