GdPicture.NET Reference Guide
AddRectangleHighlighterAnnotInteractive Method (GdViewer)
Example 





GdPicture14.WPF Namespace > GdViewer Class : AddRectangleHighlighterAnnotInteractive Method
A color object that defines the required background color (a color for highlighting) of the newly added rectangle highlighter annotation.
Allows users to interactively add a new rectangle highlighter 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.

This annotation enables users to highlight a required area by adjusting the height and the width of the rectangle highlighter continuously using the mouse.

The type of the newly added annotation object is GdPictureAnnotationType.AnnotationTypeRectangleHighlighter. You can change the annotation properties directly using the GdPicture14.Annotations.AnnotationRectangleHighlighter 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 AddRectangleHighlighterAnnotInteractive( _
   ByVal BackColor As Color _
) 
public void AddRectangleHighlighterAnnotInteractive( 
   Color BackColor
)
public procedure AddRectangleHighlighterAnnotInteractive( 
    BackColor: Color
); 
public function AddRectangleHighlighterAnnotInteractive( 
   BackColor : Color
);
public: void AddRectangleHighlighterAnnotInteractive( 
   Color BackColor
) 
public:
void AddRectangleHighlighterAnnotInteractive( 
   Color BackColor
) 

Parameters

BackColor
A color object that defines the required background color (a color for highlighting) of the newly added rectangle highlighter annotation.
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.

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 rectangle highlighter annotation on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated.
Sub buttonAddRectangleHighlighter_Click(ByVal sender As Object, ByVal e As EventArgs)
    GdViewer1.AddRectangleHighlighterAnnotInteractive(Color.FromArgb(255, 255, 255, 0))
    If GdViewer1.GetStat() <> GdPictureStatus.OK Then MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddRectangleHighlighterAnnotInteractive")
End Sub
//We assume that the GdViewer1 control has been properly integrated.
void buttonAddRectangleHighlighter_Click(object sender, EventArgs e)
{
    GdViewer1.AddRectangleHighlighterAnnotInteractive(Color.FromArgb(255, 255, 255, 0));
    if (GdViewer1.GetStat() != GdPictureStatus.OK) MessageBox.Show("Error!  Status: " + GdViewer1.GetStat().ToString(), "AddRectangleHighlighterAnnotInteractive");
}
See Also

Reference

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