The content of the newly added annotation, that means the text to be displayed in the annotation bounding box.
A color object that defines the required color of the used font for displaying the specified text.
The name of the font used to write the annotation content, for example Arial.
A member of the FontStyle enumeration. The font style of the used font for displaying the annotation content.
The size of the used font, in points.
Set this parameter to true, if you want to fill the annotation bounding box using the defined background color, otherwise set it to false.
A color object that defines the required border color of the annotation bounding box.
A color object that defines the required background color of the annotation bounding box.
The opacity value of the newly added annotation, from 0 (full transparency) to 1 (full opacity).
The clockwise rotation of the newly added annotation, in degrees.
Example





In This Topic
GdPicture14.WPF Namespace / GdViewer Class / AddTextAnnotationInteractive Method

AddTextAnnotationInteractive Method (GdViewer)

In This Topic
Allows users to interactively add a new text annotation using the mouse on the current page of the document displayed in the GdViewer control. The annotation object is added following all the parameters you have specified and respecting the dimensions users will define using the mouse as well.

A text annotation writes the specified text within the rectangle area defined by the user. You can prompt users to add their custom text using the DisplayTextEditBox method right after creating the annotation object.

The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeText. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationText class before or after the successful creation of the annotation object. Please refer to both the BeforeAnnotationAddedByUser and the AnnotationAddedByUser events, respectively to both the PreviewBeforeAnnotationAddedByUser and the PreviewAnnotationAddedByUser events, for how to achieve this.

Be aware that the editing mode for annotations must be enabled using the SetAnnotationEditorMode method, otherwise this method will fail.

Syntax
'Declaration
 
Public Sub AddTextAnnotationInteractive( _
   ByVal Text As String, _
   ByVal ForeColor As Color, _
   ByVal FontName As String, _
   ByVal FontStyle As FontStyle, _
   ByVal FontSize As Single, _
   ByVal Fill As Boolean, _
   ByVal BorderColor As Color, _
   ByVal BackColor As Color, _
   ByVal Opacity As Single, _
   ByVal Rotation As Single _
) 
public void AddTextAnnotationInteractive( 
   string Text,
   Color ForeColor,
   string FontName,
   FontStyle FontStyle,
   float FontSize,
   bool Fill,
   Color BorderColor,
   Color BackColor,
   float Opacity,
   float Rotation
)
public procedure AddTextAnnotationInteractive( 
    Text: String;
    ForeColor: Color;
    FontName: String;
    FontStyle: FontStyle;
    FontSize: Single;
    Fill: Boolean;
    BorderColor: Color;
    BackColor: Color;
    Opacity: Single;
    Rotation: Single
); 
public function AddTextAnnotationInteractive( 
   Text : String,
   ForeColor : Color,
   FontName : String,
   FontStyle : FontStyle,
   FontSize : float,
   Fill : boolean,
   BorderColor : Color,
   BackColor : Color,
   Opacity : float,
   Rotation : float
);
public: void AddTextAnnotationInteractive( 
   string* Text,
   Color ForeColor,
   string* FontName,
   FontStyle FontStyle,
   float FontSize,
   bool Fill,
   Color BorderColor,
   Color BackColor,
   float Opacity,
   float Rotation
) 
public:
void AddTextAnnotationInteractive( 
   String^ Text,
   Color ForeColor,
   String^ FontName,
   FontStyle FontStyle,
   float FontSize,
   bool Fill,
   Color BorderColor,
   Color BackColor,
   float Opacity,
   float Rotation
) 

Parameters

Text
The content of the newly added annotation, that means the text to be displayed in the annotation bounding box.
ForeColor
A color object that defines the required color of the used font for displaying the specified text.
FontName
The name of the font used to write the annotation content, for example Arial.
FontStyle
A member of the FontStyle enumeration. The font style of the used font for displaying the annotation content.
FontSize
The size of the used font, in points.
Fill
Set this parameter to true, if you want to fill the annotation bounding box using the defined background color, otherwise set it to false.
BorderColor
A color object that defines the required border color of the annotation bounding box.
BackColor
A color object that defines the required background color of the annotation bounding box.
Opacity
The opacity value of the newly added annotation, from 0 (full transparency) to 1 (full opacity).
Rotation
The clockwise rotation of the newly added annotation, in degrees.
Remarks
The GetStat method can be subsequently used to determine if this method has been successful. If the editing mode for annotations is disabled, the method will fail.
Example
How to allow users to interactively add text annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddTextNote_Click(ByVal sender As Object, ByVal e As EventArgs)
    GdViewer1.AddTextAnnotationInteractive("GdPicture Annotation Text", Color.FromArgb(255, 138, 43, 226), "Arial", FontStyle.Regular, 14, True,
                                           Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 245, 245, 220), 0.75F, 0)
    If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddTextAnnotationInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddTextNote_Click(object sender, EventArgs e)
{
    GdViewer1.AddTextAnnotationInteractive("GdPicture Annotation Text", Color.FromArgb(255, 138, 43, 226), "Arial", FontStyle.Regular, 14,
                                           true, Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 245, 245, 220), 0.75f, 0);
    if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddTextAnnotationInteractive");
}
See Also