GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / AddStickyNoteAnnotationInteractive Method
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.
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
AddStickyNoteAnnotationInteractive Method (GdViewer)
In This Topic
Allows users to interactively add a new sticky note 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 sticky note annotation writes the specified text within the filled and bordered 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.AnnotationTypeStickyNote. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationStickyNote class before or after the successful creation of the annotation object. Please refer to both the BeforeAnnotationAddedByUser and the AnnotationAddedByUser 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.

Allows users to interactively add a new sticky note annotation using the mouse on the current page of the document displayed in the GdViewer control.
Syntax
'Declaration
 
Public Sub AddStickyNoteAnnotationInteractive( _
   ByVal Text As String, _
   ByVal ForeColor As Color, _
   ByVal FontName As String, _
   ByVal FontStyle As FontStyle, _
   ByVal FontSize As Single, _
   ByVal Opacity As Single, _
   ByVal Rotation As Single _
) 
public void AddStickyNoteAnnotationInteractive( 
   string Text,
   Color ForeColor,
   string FontName,
   FontStyle FontStyle,
   float FontSize,
   float Opacity,
   float Rotation
)
public procedure AddStickyNoteAnnotationInteractive( 
    Text: String;
    ForeColor: Color;
    FontName: String;
    FontStyle: FontStyle;
    FontSize: Single;
    Opacity: Single;
    Rotation: Single
); 
public function AddStickyNoteAnnotationInteractive( 
   Text : String,
   ForeColor : Color,
   FontName : String,
   FontStyle : FontStyle,
   FontSize : float,
   Opacity : float,
   Rotation : float
);
public: void AddStickyNoteAnnotationInteractive( 
   string* Text,
   Color ForeColor,
   string* FontName,
   FontStyle FontStyle,
   float FontSize,
   float Opacity,
   float Rotation
) 
public:
void AddStickyNoteAnnotationInteractive( 
   String^ Text,
   Color ForeColor,
   String^ FontName,
   FontStyle FontStyle,
   float FontSize,
   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.
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 a sticky note annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddStickyNote_Click(ByVal sender As Object, ByVal e As EventArgs)
    GdViewer1.AddStickyNoteAnnotationInteractive("GdPicture Annotation Sticky Note", Color.BlueViolet, "Arial", FontStyle.Regular, 14, 0.75F, 0)
    If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddStickyNoteAnnotationInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddStickyNote_Click(object sender, EventArgs e)
{
    GdViewer1.AddStickyNoteAnnotationInteractive("GdPicture Annotation Sticky Note", Color.BlueViolet, "Arial", FontStyle.Regular, 14, 0.75f, 0);
    if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddStickyNoteAnnotationInteractive");
}
See Also