Reference Guide
GdPicture14.WPF Namespace / GdViewer Class / AddLinkAnnotationInteractive Method
The text to render, means the displayed text, of the newly added link annotation.
The destination of the newly added link annotation, for example http://www.gdpicture.com or page:5. It corresponds to the AnnotationLink.Link property.
A color object that defines the required color of the used font for displaying the specified text.
A color object that defines the required color of the used font for displaying the specified text when users hover the mouse over the link annotation object.

Be aware, that mouse-hovering is only active when the editing mode for annotations is disabled.

The name of the font used to write the defiend text, for example Arial.
A member of the FontStyle enumeration. The font style of the used font for writing the defined text.
A member of the FontStyle enumeration. The font style of the used font for writing the defined text when users hover the mouse over the link annotation object.

Be aware, that mouse-hovering is only active when the editing mode for annotations is disabled.

The opacity value of the newly added link annotation, from 0 (full transparency) to 1 (full opacity).
The clockwise rotation of the newly added link annotation, in degrees.
Example





In This Topic
    AddLinkAnnotationInteractive Method (GdViewer)
    In This Topic
    Allows users to interactively add a new link 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 link annotation depicts the defined text, that points to a link destination, that means to a web site or to a page in the current document.

    The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeLink. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationLink 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 AddLinkAnnotationInteractive( _
       ByVal Text As String, _
       ByVal Link As String, _
       ByVal ForeColor As Color, _
       ByVal HoverForeColor As Color, _
       ByVal FontName As String, _
       ByVal FontStyle As FontStyle, _
       ByVal HoverFontStyle As FontStyle, _
       ByVal Opacity As Single, _
       ByVal Rotation As Single _
    ) 
    public void AddLinkAnnotationInteractive( 
       string Text,
       string Link,
       Color ForeColor,
       Color HoverForeColor,
       string FontName,
       FontStyle FontStyle,
       FontStyle HoverFontStyle,
       float Opacity,
       float Rotation
    )
    public procedure AddLinkAnnotationInteractive( 
        Text: String;
        Link: String;
        ForeColor: Color;
        HoverForeColor: Color;
        FontName: String;
        FontStyle: FontStyle;
        HoverFontStyle: FontStyle;
        Opacity: Single;
        Rotation: Single
    ); 
    public function AddLinkAnnotationInteractive( 
       Text : String,
       Link : String,
       ForeColor : Color,
       HoverForeColor : Color,
       FontName : String,
       FontStyle : FontStyle,
       HoverFontStyle : FontStyle,
       Opacity : float,
       Rotation : float
    );
    public: void AddLinkAnnotationInteractive( 
       string* Text,
       string* Link,
       Color ForeColor,
       Color HoverForeColor,
       string* FontName,
       FontStyle FontStyle,
       FontStyle HoverFontStyle,
       float Opacity,
       float Rotation
    ) 
    public:
    void AddLinkAnnotationInteractive( 
       String^ Text,
       String^ Link,
       Color ForeColor,
       Color HoverForeColor,
       String^ FontName,
       FontStyle FontStyle,
       FontStyle HoverFontStyle,
       float Opacity,
       float Rotation
    ) 

    Parameters

    Text
    The text to render, means the displayed text, of the newly added link annotation.
    Link
    The destination of the newly added link annotation, for example http://www.gdpicture.com or page:5. It corresponds to the AnnotationLink.Link property.
    ForeColor
    A color object that defines the required color of the used font for displaying the specified text.
    HoverForeColor
    A color object that defines the required color of the used font for displaying the specified text when users hover the mouse over the link annotation object.

    Be aware, that mouse-hovering is only active when the editing mode for annotations is disabled.

    FontName
    The name of the font used to write the defiend text, for example Arial.
    FontStyle
    A member of the FontStyle enumeration. The font style of the used font for writing the defined text.
    HoverFontStyle
    A member of the FontStyle enumeration. The font style of the used font for writing the defined text when users hover the mouse over the link annotation object.

    Be aware, that mouse-hovering is only active when the editing mode for annotations is disabled.

    Opacity
    The opacity value of the newly added link annotation, from 0 (full transparency) to 1 (full opacity).
    Rotation
    The clockwise rotation of the newly added link annotation, in degrees.
    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 link annotation on the currently displayed page.
    'We assume that the GdViewer1 control has been properly integrated.
    Sub buttonAddLink_Click(ByVal sender As Object, ByVal e As EventArgs)
        GdViewer1.AddLinkAnnotationInteractive("gdpicture", "www.gdpicture.com", Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 255, 0, 0), "Arial", System.Drawing.FontStyle.Regular, System.Drawing.FontStyle.Bold, 1, 0)
        If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddLinkAnnotationInteractive")
    End Sub
    //We assume that the GdViewer1 control has been properly integrated.
    void buttonAddLink_Click(object sender, EventArgs e)
    {
        GdViewer1.AddLinkAnnotationInteractive("gdpicture", "www.gdpicture.com", Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 255, 0, 0), "Arial", System.Drawing.FontStyle.Regular, System.Drawing.FontStyle.Bold, 1, 0);
        if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddLinkAnnotationInteractive");
    }
    See Also