GdPicture.NET Reference Guide
ADRAddGdPictureImageToTemplate Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : ADRAddGdPictureImageToTemplate Method
The existing template ID to add the new image.
The image to add to the existing template.
Adds an image to a Document Identifier Template from a GdPicture Image.
Syntax
'Declaration
 
Public Function ADRAddGdPictureImageToTemplate( _
   ByVal TemplateID As Integer, _
   ByVal ImageID As Integer _
) As GdPictureStatus
public GdPictureStatus ADRAddGdPictureImageToTemplate( 
   int TemplateID,
   int ImageID
)
public function ADRAddGdPictureImageToTemplate( 
    TemplateID: Integer;
    ImageID: Integer
): GdPictureStatus; 
public function ADRAddGdPictureImageToTemplate( 
   TemplateID : int,
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus ADRAddGdPictureImageToTemplate( 
   int TemplateID,
   int ImageID
) 
public:
GdPictureStatus ADRAddGdPictureImageToTemplate( 
   int TemplateID,
   int ImageID
) 

Parameters

TemplateID
The existing template ID to add the new image.
ImageID
The image to add to the existing template.

Return Value

A member of the GdPictureStatus enumeration.
Example
How to create document templates and identify the one which has the closest similar content to an image file.
Dim TemplateID1 As Integer, TemplateID2 As Integer
Dim ImageID1 As Integer, ImageID2 As Integer
Dim nCloserTemplate As Integer
'We create the first template from an image
TemplateID1 = oGdPictureImaging.ADRCreateTemplateEmpty
ImageID1 = oGdPictureImaging.CreateGdPictureImageFromFile("template1.tif")
If  oGdPictureImaging.ADRAddGdPictureImageToTemplate(TemplateID1, ImageID1) <> OK Then
   MessageBox.Show("Can't add image to TemplateID1 " + "Error number: " + oGdPictureImaging.GetStat().ToString())
End If
'We create the second template from an other kind of image
TemplateID2 = oGdPictureImaging.ADRCreateTemplateEmpty
ImageID2 = oGdPictureImaging.CreateGdPictureImageFromFile("template2.tif")
If  oGdPictureImaging.ADRAddGdPictureImageToTemplate(TemplateID2, ImageID2) <> OK Then
   MessageBox.Show("Can't add image to TemplateID2 " + "Error number: " + oGdPictureImaging.GetStat().ToString())
End If
'Now, we will try to identify an image.
nCloserTemplate = oGdPictureImaging.ADRGetCloserTemplateForFile("document.tif")
Select Case nCloserTemplate
Case TemplateID1
MessageBox.Show("This image seems to get best similar content as TemplateID1. Confidence is: " + oGdPictureImaging.ADRGetLastConfidence().ToString() + " %")
Case TemplateID2
MessageBox.Show("This image seems to get best similar content as TemplateID2. Confidence is: " + oGdPictureImaging.ADRGetLastConfidence().ToString() + " %")
End Select
'Release created templates from memory
oGdPictureImaging.ADRDeleteTemplate (TemplateID1)
oGdPictureImaging.ADRDeleteTemplate (TemplateID2)
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members