Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / AddLineAnnotInteractive Method
A color object that defines the required color of the newly added line annotation. It corresponds to the AnnotationLine.StrokeColor property.
The width of the newly added line annotation, in inches. It corresponds to the AnnotationLine.BorderWidth property.
A member of the PenLineCap enumeration. Specifies the cap style used at the beginning of a drawn line.
A member of the PenLineCap enumeration. Specifies the cap style used at the end of a drawn line.
The opacity value of the newly added line annotation, from 0 (full transparency) to 1 (full opacity).
Example





In This Topic
    AddLineAnnotInteractive Method (GdViewer)
    In This Topic
    Allows users to interactively add a new line 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 line annotation presents a single straight line with specified cap styles on its ending points.

    The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeLine. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationLine 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 AddLineAnnotInteractive( _
       ByVal BorderColor As Color, _
       ByVal BorderWidth As Single, _
       ByVal StartCap As PenLineCap, _
       ByVal EndCap As PenLineCap, _
       ByVal Opacity As Single _
    ) 
    public void AddLineAnnotInteractive( 
       Color BorderColor,
       float BorderWidth,
       PenLineCap StartCap,
       PenLineCap EndCap,
       float Opacity
    )
    public procedure AddLineAnnotInteractive( 
        BorderColor: Color;
        BorderWidth: Single;
        StartCap: PenLineCap;
        EndCap: PenLineCap;
        Opacity: Single
    ); 
    public function AddLineAnnotInteractive( 
       BorderColor : Color,
       BorderWidth : float,
       StartCap : PenLineCap,
       EndCap : PenLineCap,
       Opacity : float
    );
    public: void AddLineAnnotInteractive( 
       Color BorderColor,
       float BorderWidth,
       PenLineCap StartCap,
       PenLineCap EndCap,
       float Opacity
    ) 
    public:
    void AddLineAnnotInteractive( 
       Color BorderColor,
       float BorderWidth,
       PenLineCap StartCap,
       PenLineCap EndCap,
       float Opacity
    ) 

    Parameters

    BorderColor
    A color object that defines the required color of the newly added line annotation. It corresponds to the AnnotationLine.StrokeColor property.
    BorderWidth
    The width of the newly added line annotation, in inches. It corresponds to the AnnotationLine.BorderWidth property.
    StartCap
    A member of the PenLineCap enumeration. Specifies the cap style used at the beginning of a drawn line.
    EndCap
    A member of the PenLineCap enumeration. Specifies the cap style used at the end of a drawn line.
    Opacity
    The opacity value of the newly added line 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.
    Example
    How to allow users to interactively add a line annotation on the currently displayed page.
    'We assume that the GdViewer1 control has been properly integrated.
    Sub buttonAddLine_Click(ByVal sender As Object, ByVal e As EventArgs)
        GdViewer1.AddLineAnnotInteractive(Color.FromArgb(255, 138, 43, 226), 0.15F, System.Windows.Media.PenLineCap.Flat, System.Windows.Media.PenLineCap.Triangle, 0.75F)
        If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddLineAnnotInteractive")
    End Sub
    //We assume that the GdViewer1 control has been properly integrated.
    void buttonAddLine_Click(object sender, EventArgs e)
    {
        GdViewer1.AddLineAnnotInteractive(Color.FromArgb(255, 138, 43, 226), 0.15f, System.Windows.Media.PenLineCap.Flat, System.Windows.Media.PenLineCap.Triangle, 0.75f);
        if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddLineAnnotInteractive");
    }
    See Also