A color object that defines the required border color of the newly added freehand polygon annotation.
The border width of the newly added freehand polygon annotation, in inches.
A color object that defines the required background color of the newly added freehand polygon annotation.
The opacity value of the newly added freehand polygon annotation, from 0 (full transparency) to 1 (full opacity).
Example





In This Topic
GdPicture14 Namespace / GdViewer Class / AddFreeHandPolygonAnnotInteractive Method

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 BorderColor As Color, _
   ByVal BorderWidth As Single, _
   ByVal BackColor As Color, _
   ByVal Opacity As Single _
) 
public void AddFreeHandPolygonAnnotInteractive( 
   Color BorderColor,
   float BorderWidth,
   Color BackColor,
   float Opacity
)
public procedure AddFreeHandPolygonAnnotInteractive( 
    BorderColor: Color;
    BorderWidth: Single;
    BackColor: Color;
    Opacity: Single
); 
public function AddFreeHandPolygonAnnotInteractive( 
   BorderColor : Color,
   BorderWidth : float,
   BackColor : Color,
   Opacity : float
);
public: void AddFreeHandPolygonAnnotInteractive( 
   Color BorderColor,
   float BorderWidth,
   Color BackColor,
   float Opacity
) 
public:
void AddFreeHandPolygonAnnotInteractive( 
   Color BorderColor,
   float BorderWidth,
   Color BackColor,
   float Opacity
) 

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).
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 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