GdPicture.NET Reference Guide
GetAnnotationCount Method (GdViewer)
Example 





GdPicture14.WPF Namespace > GdViewer Class : GetAnnotationCount Method
Returns the number of all GdPicture/XMP annotation objects contained within the current page of the document displayed in the GdViewer control.

Be aware that this method only handles GdPicture/XMP annotations.

Syntax
'Declaration
 
Public Function GetAnnotationCount() As Integer
public int GetAnnotationCount()
public function GetAnnotationCount(): Integer; 
public function GetAnnotationCount() : int;
public: int GetAnnotationCount(); 
public:
int GetAnnotationCount(); 

Return Value

The number of all GdPicture/XMP annotation objects included within the current page of the displayed document.
Remarks
Be aware that annotations are always treated relative to the currently displayed page.

Please note that this method expects to have the GdPicture XMP/Annotations Plugin to be unlocked. The method only handles GdPicture/XMP annotations as well.

You can regularly apply the GetStat method to determine if this method has been successful.

Example
How to find out the number of GdPicture/XMP annotations on the currently displayed page.
'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
Dim annotCount As Integer = GdViewer1.GetAnnotationCount()
Dim message As String = "The number of GdPicture/XMP annotations on the current page: " + annotCount
Dim annot As GdPicture14.Annotations.Annotation = Nothing
If annotCount > 0 Then
    annot = GdViewer1.GetAnnotationFromIdx(0)
    message = message + vbCrLf + "The author of the first one is: " + annot.Author
End If
MessageBox.Show(message, "GdViewer.GetAnnotationCount")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
int annotCount = GdViewer1.GetAnnotationCount();
string message = "The number of GdPicture/XMP annotations on the current page: " + annotCount;
GdPicture14.Annotations.Annotation annot = null;
if (annotCount > 0)
{
    annot = GdViewer1.GetAnnotationFromIdx(0);
    message = message + "\nThe author of the first one is: " + annot.Author;
}
MessageBox.Show(message, "GdViewer.GetAnnotationCount");
See Also

Reference

GdViewer Class
GdViewer Members
GetAnnotationFromIdx Method
GetSelectedAnnotationIdx Method
SelectAnnotation Method
DeleteAnnotation Method
GetAnnotationManager Method