The AnnRichTextDrawDesigner Class is available in LEADTOOLS Document and Medical Imaging toolkits.
This class extends the AnnRectangleDrawDesigner class to provide functionality for drawing an AnnRichTextObject on an annotation container.Visual Basic (Declaration) | |
---|---|
<SerializableAttribute()> Public Class AnnRichTextDrawDesigner Inherits AnnRectangleDrawDesigner |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As AnnRichTextDrawDesigner |
C# | |
---|---|
[SerializableAttribute()] public class AnnRichTextDrawDesigner : AnnRectangleDrawDesigner |
C++/CLI | |
---|---|
[SerializableAttribute()] public ref class AnnRichTextDrawDesigner : public AnnRectangleDrawDesigner |
For a complete example on how to use annotation draw and edit designers, refer to AnnDesigner.
This example initializes a new designer to draw rich text objects.
Visual Basic | Copy Code |
---|---|
Public Function AnnRichTextDrawDesigner_AnnRichTextDrawDesigner(ByVal viewer As RasterImageViewer, ByVal container As AnnContainer) As AnnRichTextDrawDesigner ' start a new rich text draw designer Dim richTextDrawDesigner As New AnnRichTextDrawDesigner() ' set up the object template (the rich text object) Dim richTextObject As New AnnRichTextObject() richTextObject.Pen = Nothing richTextObject.Brush = Nothing ' set up the default text to be used ' This is RTF text that is equals to LEADTOOLS in bold red Arial richTextDrawDesigner.DefaultRtf = _ "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}" + _ "{\f1\fnil\fcharset0 Microsoft Sans Serif;}}{\colortbl ;\red255\green0\blue0;}" + _ "\viewkind4\uc1\pard\cf1\lang9\b\i\fs22 LEADTOOLS\cf0\lang1033\b0\i0\f1\fs17\par}" ' initialize the rest of the designer richTextDrawDesigner.ObjectTemplate = richTextObject richTextDrawDesigner.Owner = viewer richTextDrawDesigner.ClipCursor = True richTextDrawDesigner.Container = container Return richTextDrawDesigner End Function |
C# | Copy Code |
---|---|
public AnnRichTextDrawDesigner AnnRichTextDrawDesigner_AnnRichTextDrawDesigner(RasterImageViewer viewer, AnnContainer container) { // start a new rich text draw designer AnnRichTextDrawDesigner richTextDrawDesigner = new AnnRichTextDrawDesigner(); // set up the object template (the rich text object) AnnRichTextObject richTextObject = new AnnRichTextObject(); richTextObject.Pen = null; richTextObject.Brush = null; // set up the default text to be used richTextDrawDesigner.DefaultRtf = // This is RTF text that is equals to LEADTOOLS in bold red Arial @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}" + @"{\f1\fnil\fcharset0 Microsoft Sans Serif;}}{\colortbl ;\red255\green0\blue0;}" + @"\viewkind4\uc1\pard\cf1\lang9\b\i\fs22 LEADTOOLS\cf0\lang1033\b0\i0\f1\fs17\par}"; // initialize the rest of the designer richTextDrawDesigner.ObjectTemplate = richTextObject; richTextDrawDesigner.Owner = viewer; richTextDrawDesigner.ClipCursor = true; richTextDrawDesigner.Container = container; return richTextDrawDesigner; } |
System.Object
Leadtools.Annotations.AnnDesigner
Leadtools.Annotations.AnnDrawDesigner
Leadtools.Annotations.AnnRectangleDrawDesigner
Leadtools.Annotations.AnnRichTextDrawDesigner
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7