AddPolygonAnnotInteractive Method (GdViewer)
In This Topic
Allows users to interactively add a new 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.
Users start drawing a polygon with a single line. Each single click adds a new polygon vertice. To finish the polygon they use a double-click.
The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypePolygon. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationPolygon 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 polygon annotation using the mouse on the current page of the document displayed in the GdViewer control.
Syntax
'Declaration
Public Sub AddPolygonAnnotInteractive( _
ByVal As Color, _
ByVal As Single, _
ByVal As Color, _
ByVal As Single _
)
public void AddPolygonAnnotInteractive(
Color ,
float ,
Color ,
float
)
public procedure AddPolygonAnnotInteractive(
: Color;
: Single;
: Color;
: Single
);
public function AddPolygonAnnotInteractive(
: Color,
: float,
: Color,
: float
);
public: void AddPolygonAnnotInteractive(
Color ,
float ,
Color ,
float
)
public:
void AddPolygonAnnotInteractive(
Color ,
float ,
Color ,
float
)
Parameters
- BorderColor
- A color object that defines the required border color of the newly added polygon annotation.
- BorderWidth
- The border width of the newly added polygon annotation, in inches.
- BackColor
- A color object that defines the required background color of the newly added polygon annotation.
- Opacity
- The opacity value of the newly added polygon annotation, from 0 (full transparency) to 1 (full opacity).
Example
How to allow users to interactively add a polygon annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddPolygon_Click(ByVal sender As Object, ByVal e As EventArgs)
GdViewer1.AddPolygonAnnotInteractive(Color.Blue, 0.05F, Color.Yellow, 1)
If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddPolygonAnnotInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddPolygon_Click(object sender, EventArgs e)
{
GdViewer1.AddPolygonAnnotInteractive(Color.Blue, 0.05f, Color.Yellow, 1);
if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddPolygonAnnotInteractive");
}
Example
How to allow users to interactively add a polygon annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddPolygon_Click(ByVal sender As Object, ByVal e As EventArgs)
GdViewer1.AddPolygonAnnotInteractive(Color.Blue, 0.05F, Color.Yellow, 1)
If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddPolygonAnnotInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddPolygon_Click(object sender, EventArgs e)
{
GdViewer1.AddPolygonAnnotInteractive(Color.Blue, 0.05f, Color.Yellow, 1);
if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error! Status: " + GdViewer1.GetStat().ToString(), "AddPolygonAnnotInteractive");
}
See Also