AddFreeHandPolygonAnnotInteractive Method (GdViewer)
In This Topic
Allows users to interactively add a new freehand polygon 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 freehand polygon is an arbitrary closed shape which users paint by moving the mouse. Drawing a polygon starts with pressing the mouse button and it finishes with releasing the mouse button.
The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeFreeHandPolygon. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationFreeHandPolygon 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 freehand polygon annotation using the mouse on the current page of the document displayed in the GdViewer control.
Syntax
'Declaration
Public Sub AddFreeHandPolygonAnnotInteractive( _
ByVal As Color, _
ByVal As Single, _
ByVal As Color, _
ByVal As Single _
)
public void AddFreeHandPolygonAnnotInteractive(
Color ,
float ,
Color ,
float
)
public procedure AddFreeHandPolygonAnnotInteractive(
: Color;
: Single;
: Color;
: Single
);
public function AddFreeHandPolygonAnnotInteractive(
: Color,
: float,
: Color,
: float
);
public: void AddFreeHandPolygonAnnotInteractive(
Color ,
float ,
Color ,
float
)
public:
void AddFreeHandPolygonAnnotInteractive(
Color ,
float ,
Color ,
float
)
Parameters
- BorderColor
- A color object that defines the required border color of the newly added freehand polygon annotation.
- BorderWidth
- The border width of the newly added freehand polygon annotation, in inches.
- BackColor
- A color object that defines the required background color of the newly added freehand polygon annotation.
- Opacity
- The opacity value of the newly added freehand polygon annotation, from 0 (full transparency) to 1 (full opacity).
Example
How to allow users to interactively add a freehand polygon annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddFreeHandPolygon_Click(ByVal sender As Object, ByVal e As EventArgs)
GdViewer1.AddFreeHandPolygonAnnotInteractive(Color.BlueViolet, 0.1F, Color.Beige, 1)
If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddFreeHandPolygonAnnotInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddFreeHandPolygon_Click(object sender, EventArgs e)
{
GdViewer1.AddFreeHandPolygonAnnotInteractive(Color.BlueViolet, 0.1f, Color.Beige, 1);
if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddFreeHandPolygonAnnotInteractive");
}
See Also