GdPicture.NET Reference Guide
ADRGetTemplateCount Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ADRGetTemplateCount Method
Returns the current number of Document Identifier Templates.
Syntax
'Declaration
 
Public Function ADRGetTemplateCount() As Integer
public int ADRGetTemplateCount()
public function ADRGetTemplateCount(): Integer; 
public function ADRGetTemplateCount() : int;
public: int ADRGetTemplateCount(); 
public:
int ADRGetTemplateCount(); 

Return Value

The number of document identifier templates.
Example
Making sure that every template is based on at least one image.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID1 As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("template1.tif")
Dim TemplateID1 As Integer = oGdPictureImaging.ADRCreateTemplateEmpty()
Dim TemplateID2 As Integer = oGdPictureImaging.ADRCreateTemplateEmpty()
Dim TemplateID3 As Integer = oGdPictureImaging.ADRCreateTemplateEmpty()
If  oGdPictureImaging.ADRAddGdPictureImageToTemplate(TemplateID1, ImageID1) <> OK Then
   MessageBox.Show("Can't add image to TemplateID1 " + "Error number: " + oGdPictureImaging.GetStat().ToString())
End If
If oGdPictureImaging.ADRGetTemplateCount() > 0 Then
   For i As Integer = 1 To oGdPictureImaging.ADRGetTemplateCount
      Dim templateID As Integer = oGdPictureImaging.ADRGetTemplateID(i)
      If oGdPictureImaging.ADRGetTemplateImageCount(templateID) = 0 Then
         MessageBox.Show("Please add image to template: " + str(templateID))
         Exit For
      End If
   Next
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members