This class extends the
AnnRectangleDrawDesigner class to provide functionality for drawing an
AnnTextObject on an annotation container.
Object Model
Syntax
Example
For a complete example on how to use annotation draw and edit designers, refer to AnnDesigner
This example initializes a new designer to draw text objects.
Visual Basic | Copy Code |
---|
Public Function AnnTextDrawDesigner_AnnTextDrawDesigner(ByVal viewer As RasterImageViewer, ByVal container As AnnContainer) As AnnTextDrawDesigner
Dim textDrawDesigner As AnnTextDrawDesigner = New AnnTextDrawDesigner()
Dim textObject As AnnTextObject = New AnnTextObject()
textObject.Pen = Nothing
textObject.Brush = Nothing
textObject.Font = New AnnFont("Arial", New AnnLength(10, AnnUnit.Point), FontStyle.Regular)
textObject.EdgeMargin = AnnLength.Empty
textObject.Alignment = StringAlignment.Center
textObject.LineAlignment = StringAlignment.Center
textDrawDesigner.DefaultText = "Leadtools"
textDrawDesigner.ObjectTemplate = textObject
textDrawDesigner.Owner = viewer
textDrawDesigner.ClipCursor = True
textDrawDesigner.Container = container
Return textDrawDesigner
End Function |
C# | Copy Code |
---|
public AnnTextDrawDesigner AnnTextDrawDesigner_AnnTextDrawDesigner(RasterImageViewer viewer, AnnContainer container) { // start a new text draw designer AnnTextDrawDesigner textDrawDesigner = new AnnTextDrawDesigner(); // set up the object template (the text object) AnnTextObject textObject = new AnnTextObject(); textObject.Pen = null; textObject.Brush = null; textObject.Font = new AnnFont("Arial", new AnnLength(10, AnnUnit.Point), FontStyle.Regular); textObject.EdgeMargin = AnnLength.Empty; textObject.Alignment = StringAlignment.Center; textObject.LineAlignment = StringAlignment.Center; // set up the default text to be used textDrawDesigner.DefaultText = "Leadtools"; // initialize the rest of the designer textDrawDesigner.ObjectTemplate = textObject; textDrawDesigner.Owner = viewer; textDrawDesigner.ClipCursor = true; textDrawDesigner.Container = container; return textDrawDesigner; } |
Inheritance Hierarchy
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also