GdPicture.NET Reference Guide
ADRGetTemplateID Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ADRGetTemplateID Method
Template index. Value between 1 and ADRGetTemplateCount().
Returns a Document Identifier Template ID from his index.
Syntax
'Declaration
 
Public Function ADRGetTemplateID( _
   ByVal TemplateNo As Integer _
) As Integer
public int ADRGetTemplateID( 
   int TemplateNo
)
public function ADRGetTemplateID( 
    TemplateNo: Integer
): Integer; 
public function ADRGetTemplateID( 
   TemplateNo : int
) : int;
public: int ADRGetTemplateID( 
   int TemplateNo
) 
public:
int ADRGetTemplateID( 
   int TemplateNo
) 

Parameters

TemplateNo
Template index. Value between 1 and ADRGetTemplateCount().

Return Value

The Template ID. If TemplateNo is invalid, returns -1.
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