The AnnTextObject Class supports WPF/Silverlight.
The AnnTextObject Class is available in LEADTOOLS Document and Medical Imaging toolkits.
This class provides support for creating and managing Text annotation objects
Supported in Silverlight, Windows Phone 7
Object Model
Syntax
Example
For XAML example, refer to AnnGroupObject.
This example creates a new text object.
Visual Basic | Copy 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 |
C# | Copy Code |
---|
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);
} |
SilverlightCSharp | Copy Code |
---|
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);
} |
SilverlightVB | Copy Code |
---|
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 |
Remarks
Inheritance Hierarchy
Requirements
Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)
See Also