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 As String, _
ByVal As Color, _
ByVal As String, _
ByVal As FontStyle, _
ByVal As Single, _
ByVal As Single, _
ByVal As Single _
)
public void AddStickyNoteAnnotationInteractive(
string ,
Color ,
string ,
FontStyle ,
float ,
float ,
float
)
public procedure AddStickyNoteAnnotationInteractive(
: String;
: Color;
: String;
: FontStyle;
: Single;
: Single;
: Single
);
public function AddStickyNoteAnnotationInteractive(
: String,
: Color,
: String,
: FontStyle,
: float,
: float,
: float
);
public: void AddStickyNoteAnnotationInteractive(
string* ,
Color ,
string* ,
FontStyle ,
float ,
float ,
float
)
public:
void AddStickyNoteAnnotationInteractive(
String^ ,
Color ,
String^ ,
FontStyle ,
float ,
float ,
float
)
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.
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");
}
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