Leadtools.Windows.Annotations Requires Document/Medical license. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AnnTextObject Class
See Also  Members   Example 
Leadtools.Windows.Annotations Namespace : AnnTextObject Class





This class provides support for creating and managing Text annotation objects

Object Model



Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class AnnTextObject 
   Inherits AnnRectangleObject
   Implements IAnnTextObject 
Visual Basic (Usage)Copy Code
Dim instance As AnnTextObject
C# 
[SerializableAttribute()]
public class AnnTextObject : AnnRectangleObject, IAnnTextObject  
C++/CLI 
[SerializableAttribute()]
public ref class AnnTextObject : public AnnRectangleObject, IAnnTextObject  
XAML Object Element Usage 

<AnnTextObject .../>

XAML Object Element Usage 

<AnnTextObject .../>

Example

For XAML example, refer to AnnGroupObject.

This example creates a new text object.

Visual BasicCopy Code
Private Sub AnnTextObject_AnnTextObject(ByVal container As AnnContainer, ByVal textString As String)
    Dim text As AnnTextObject = New AnnTextObject()
  text.Stroke = Brushes.Red
  text.StrokeThickness = 3.0
  text.Text = textString
  text.Fill = Nothing
  text.FontFamily = New FontFamily("Arial")
  text.FontSize = 10.0
  text.FontStretch = FontStretches.Normal
  text.FontStyle = FontStyles.Normal
  text.FontWeight = FontWeights.Bold
  text.TextBrush = Brushes.Yellow
  text.FontDecorations = New TextDecorationCollection()
  text.FontDecorations.Add(TextDecorations.Underline)
  text.TextEdgeMargin = 0.0
    text.TextHorizontalAlignment = AnnTextAlignment.Center
    text.TextVerticalAlignment = AnnTextAlignment.Center
  text.TextRotate = AnnTextRotate.Rotate0
  text.Left = 100
  text.Top = 100
  text.Width = 100
  text.Height = 100
  container.Children.Add(text)
End Sub
C#Copy Code
private void AnnTextObject_AnnTextObject(AnnContainer container, string textString) 

   AnnTextObject text = new AnnTextObject(); 
   text.Stroke = Brushes.Red; 
   text.StrokeThickness = 3.0; 
   text.Text = textString; 
   text.Fill = null; 
   text.FontFamily = new FontFamily("Arial"); 
   text.FontSize = 10.0; 
   text.FontStretch = FontStretches.Normal; 
   text.FontStyle = FontStyles.Normal; 
   text.FontWeight = FontWeights.Bold; 
   text.TextBrush = Brushes.Yellow; 
   text.FontDecorations = new TextDecorationCollection(); 
   text.FontDecorations.Add(TextDecorations.Underline); 
   text.TextEdgeMargin = 0.0; 
   text.TextHorizontalAlignment = AnnTextAlignment.Center; 
   text.TextVerticalAlignment = AnnTextAlignment.Center; 
   text.TextRotate = AnnTextRotate.Rotate0; 
   text.Left = 100; 
   text.Top = 100; 
   text.Width = 100; 
   text.Height = 100; 
   container.Children.Add(text); 
}

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.

Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  Leadtools.Windows.Annotations.AnnObjectBase
                     Leadtools.Windows.Annotations.AnnRectangleObject
                        Leadtools.Windows.Annotations.AnnTextObject
                           Leadtools.Windows.Annotations.AnnButtonObject
                           Leadtools.Windows.Annotations.AnnNoteObject
                           Leadtools.Windows.Annotations.AnnStampObject
                           Leadtools.Windows.Annotations.AnnTextPointerObject

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also

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