LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly)
LEAD Technologies, Inc

AnnTextObject Class

Example 





Members 
This class provides support for creating and managing Text annotation objects .NET support Silverlight support
Object Model
AnnTextObject ClassAnnBrush ClassAnnBrush Class
Syntax
public class AnnTextObject : AnnRectangleObject, IAnnFontIAnnHeaderIAnnObjectIAnnRectangleIAnnText  
'Declaration
 
Public Class AnnTextObject 
   Inherits AnnRectangleObject
   Implements IAnnFontIAnnHeaderIAnnObjectIAnnRectangleIAnnText 
'Usage
 
Dim instance As AnnTextObject
public sealed class AnnTextObject : IAnnFontIAnnHeaderIAnnObjectIAnnRectangleIAnnText  
function Leadtools.Windows.Annotations.AnnTextObject()
public ref class AnnTextObject : public AnnRectangleObject, IAnnFontIAnnHeaderIAnnObjectIAnnRectangleIAnnText  
Remarks

The text annotation object is a text string within a bounding rectangle. This class supports a stroke and fill, that may be used on the bounding rectangle, if needed.
For more information, refer to Using Text in WPF Annotation Objects. For more information about the text annotation object refer to AnnTextObject for WPF. For more information about the automated text annotation object, refer to WPF Annotation Objects - Automated Features.

Example

For XAML example, refer to AnnGroupObject.

Copy CodeCopy Code  
Private Sub AnnTextObject_AnnTextObject(ByVal container As AnnContainer, ByVal textString As String)
   Dim text As AnnTextObject = New AnnTextObject()
   text.Stroke = Colors.Red
   text.StrokeThickness = 3.0
   text.Text = textString
   text.Fill = Nothing
   text.FontFamilyName = "Arial"
   text.FontSize = 10.0
   text.FontStretch = AnnFontStretches.Normal
   text.FontStyle = AnnFontStyle.Normal
   text.FontWeight = AnnFontWeight.Bold
   text.Foreground = Colors.Yellow
   text.FontDecoration = New TextDecorationCollection()
   text.FontDecoration.Add(TextDecorations.Underline)
   text.TextEdgeMargin = 0.0
   text.TextHorizontalAlignment = AnnTextAlignment.Center
   text.TextVerticalAlignment = AnnTextAlignment.Center
   text.TextRotate = AnnTextRotate.Rotate0
   text.Rect = New Rect(100, 100, 100, 100)
   container.Children.Add(text)
End Sub
private void AnnTextObject_AnnTextObject(AnnContainer container, string textString)
{
   AnnTextObject text = new AnnTextObject();
   text.Stroke = Colors.Red;
   text.FontFamilyName = "Arial";
   text.Fill = Colors.Transparent;
   text.FontStretch  = AnnFontStretches.Normal;
   text.FontStyle = AnnFontStyle.Normal;
   text.FontWeight = AnnFontWeight.Bold;
   text.Foreground = Colors.Yellow;
   text.FontDecoration = new TextDecorationCollection();
   text.FontDecoration.Add(TextDecorations.Underline);
   text.Rect = new Rect(100, 100, 100, 100);
   text.StrokeThickness = 3.0;
   text.Text = textString;
   text.FontSize = 10.0;
   text.TextEdgeMargin = 0.0;
   text.TextHorizontalAlignment = AnnTextAlignment.Center;
   text.TextVerticalAlignment = AnnTextAlignment.Center;
   text.TextRotate = AnnTextRotate.Rotate0;
   container.Children.Add(text);
}
private void AnnTextObject_AnnTextObject(AnnContainer container, string textString)
{
   AnnTextObject text = new AnnTextObject();
   text.Stroke = Colors.Red;
   text.FontFamilyName = "Arial";
   text.Fill = Colors.Transparent;
   text.FontStretch  = AnnFontStretches.Normal;
   text.FontStyle = AnnFontStyle.Normal;
   text.FontWeight = AnnFontWeight.Bold;
   text.Foreground = Colors.Yellow;
   text.Rect = new Rect(100, 100, 100, 100);
   text.StrokeThickness = 3.0;
   text.Text = textString;
   text.FontSize = 10.0;
   text.TextHorizontalAlignment = AnnTextAlignment.Center;
   container.Children.Add(text);
}
Private Sub AnnTextObject_AnnTextObject(ByVal container As AnnContainer, ByVal textString As String)
   Dim text As AnnTextObject = New AnnTextObject()
   text.Stroke = Colors.Red
   text.FontFamilyName = "Arial"
   text.Fill = Colors.Transparent
   text.FontStretch = AnnFontStretches.Normal
   text.FontStyle = AnnFontStyle.Normal
   text.FontWeight = AnnFontWeight.Bold
   text.Foreground = Colors.Yellow
   text.Rect = New Rect(100, 100, 100, 100)
   text.StrokeThickness = 3.0
   text.Text = textString
   text.FontSize = 10.0
   text.TextHorizontalAlignment = AnnTextAlignment.Center
   container.Children.Add(text)
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

AnnTextObject Members
Leadtools.Windows.Annotations Namespace

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.