GdPicture.NET Reference Guide
AddConnectedLinesAnnotInteractive Method (GdViewer)
Example 





GdPicture14.WPF Namespace > GdViewer Class : AddConnectedLinesAnnotInteractive Method
A color object that defines the required color of the newly added connected lines annotation. This value defines the color of the drawn polyline and it corresponds to the AnnotationConnectedLines.StrokeColor property.
The width of the newly added connected lines annotation, in inches. This value defines the width of the drawn polyline and it corresponds to the AnnotationConnectedLines.BorderWidth property.
The opacity value of the newly added connected lines annotation, from 0 (full transparency) to 1 (full opacity).
Allows users to interactively add a new connected lines 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 connected lines annotation depicts a polyline consisting of several straight lines. This method uses the round cap style on both polyline ending points. Users end every individual line with a single click, and they finish the annotation with a double-click.

The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeConnectedLines. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationConnectedLines class before or after the successful creation of the annotation object. Please refer to both the BeforeAnnotationAddedByUser and the AnnotationAddedByUser events, respectively to both the PreviewBeforeAnnotationAddedByUser and the PreviewAnnotationAddedByUser 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.

Syntax
'Declaration
 
Public Sub AddConnectedLinesAnnotInteractive( _
   ByVal BorderColor As Color, _
   ByVal BorderWidth As Single, _
   ByVal Opacity As Single _
) 
public void AddConnectedLinesAnnotInteractive( 
   Color BorderColor,
   float BorderWidth,
   float Opacity
)
public procedure AddConnectedLinesAnnotInteractive( 
    BorderColor: Color;
    BorderWidth: Single;
    Opacity: Single
); 
public function AddConnectedLinesAnnotInteractive( 
   BorderColor : Color,
   BorderWidth : float,
   Opacity : float
);
public: void AddConnectedLinesAnnotInteractive( 
   Color BorderColor,
   float BorderWidth,
   float Opacity
) 
public:
void AddConnectedLinesAnnotInteractive( 
   Color BorderColor,
   float BorderWidth,
   float Opacity
) 

Parameters

BorderColor
A color object that defines the required color of the newly added connected lines annotation. This value defines the color of the drawn polyline and it corresponds to the AnnotationConnectedLines.StrokeColor property.
BorderWidth
The width of the newly added connected lines annotation, in inches. This value defines the width of the drawn polyline and it corresponds to the AnnotationConnectedLines.BorderWidth property.
Opacity
The opacity value of the newly added connected lines annotation, from 0 (full transparency) to 1 (full opacity).
Remarks
Please always use the GetStat method to determine if this method has been successful. If the editing mode for annotations is disabled, the method will fail.

Just to remind you that this method uses the round cap style on both polyline ending points.

Be aware that this method expects to have the GdPicture XMP/Annotations Plugin to be unlocked.

Example
How to allow users to interactively add a conected lines annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddConnectedLines_Click(ByVal sender As Object, ByVal e As EventArgs)
    GdViewer1.AddConnectedLinesAnnotInteractive(Color.FromArgb(255, 138, 43, 226), 0.1F, 0.75F)
    If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddConnectedLinesAnnotInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddConnectedLines_Click(object sender, EventArgs e)
{
    GdViewer1.AddConnectedLinesAnnotInteractive(Color.FromArgb(255, 138, 43, 226), 0.1f, 0.75f);
    if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddConnectedLinesAnnotInteractive");
}
See Also

Reference

GdViewer Class
GdViewer Members
BeforeAnnotationAddedByUser Event
AnnotationAddedByUser Event
SetAnnotationEditorMode Method
GetAnnotationCount Method
PreviewBeforeAnnotationAddedByUser Event
PreviewAnnotationAddedByUser Event