GdPicture.NET Reference Guide
ADRGetTemplateImageCount Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ADRGetTemplateImageCount Method
An existing template ID.
Returns the number of images used in a Document Identifier Template.
Syntax
'Declaration
 
Public Function ADRGetTemplateImageCount( _
   ByVal TemplateID As Integer _
) As Integer
public int ADRGetTemplateImageCount( 
   int TemplateID
)
public function ADRGetTemplateImageCount( 
    TemplateID: Integer
): Integer; 
public function ADRGetTemplateImageCount( 
   TemplateID : int
) : int;
public: int ADRGetTemplateImageCount( 
   int TemplateID
) 
public:
int ADRGetTemplateImageCount( 
   int TemplateID
) 

Parameters

TemplateID
An existing template ID.

Return Value

The number of image on which the Document Identifier Template is based.
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: " + templateID.ToString())
         Exit For
      End If
   Next
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members