GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / GetAnnotationManager Method
Example





In This Topic
GetAnnotationManager Method (GdViewer)
In This Topic
Gets the AnnotationManager object associated with the current GdViewer control object for direct use.

Using this object, you are allowed for example to handle annotations behind the associated GdViewer control.

Syntax
'Declaration
 
Public Function GetAnnotationManager() As AnnotationManager
public AnnotationManager GetAnnotationManager()
public function GetAnnotationManager(): AnnotationManager; 
public function GetAnnotationManager() : AnnotationManager;
public: AnnotationManager* GetAnnotationManager(); 
public:
AnnotationManager^ GetAnnotationManager(); 

Return Value

An AnnotationManager object associated with the GdViewer control.

Please do NOT dispose of this object during using the related GdViewer control in any way!

Remarks
Please, do NOT dispose of this object during the use of the related GdViewer control in any way!
Example
How to get the associated AnnotationManager to handle available annotations.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim annotMngr As AnnotationManager = GdViewer1.GetAnnotationManager()
Dim annot As GdPicture14.Annotations.Annotation = Nothing
For i As Integer = 1 To annotMngr.PageCount
    If annotMngr.SelectPage(i) = GdPictureStatus.OK Then
        For j As Integer = 0 To annotMngr.GetAnnotationCount() - 1
            annot = annotMngr.GetAnnotationFromIdx(j)
            If annotMngr.GetStat() = GdPictureStatus.OK Then
                annot.Visible = True
            End If
        Next
    End If
Next
annotMngr.Close()
GdViewer1.DisplayFirstPage()
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
AnnotationManager annotMngr = GdViewer1.GetAnnotationManager();
GdPicture14.Annotations.Annotation annot = null;
for (int i = 1; i <= annotMngr.PageCount; i++)
{
    if (annotMngr.SelectPage(i) == GdPictureStatus.OK)
    {
        for (int j = 0; j < annotMngr.GetAnnotationCount(); j++)
        {
            annot = annotMngr.GetAnnotationFromIdx(j);
            if (annotMngr.GetStat() == GdPictureStatus.OK)
            {
                annot.Visible = false;
            }
        }
    }
}
annotMngr.Close();
GdViewer1.DisplayFirstPage();
See Also