Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / ADRGetCloserTemplateForGdPictureImage Method
The GdPicture image.
Example





In This Topic
    ADRGetCloserTemplateForGdPictureImage Method (GdPictureImaging)
    In This Topic
    Performs a Documents Recognition Operation from a GdPicture image and returns the Document Identifier Template ID which has the best similar content.
    Syntax
    'Declaration
     
    
    Public Function ADRGetCloserTemplateForGdPictureImage( _
       ByVal ImageID As Integer _
    ) As Integer
    public int ADRGetCloserTemplateForGdPictureImage( 
       int ImageID
    )
    public function ADRGetCloserTemplateForGdPictureImage( 
        ImageID: Integer
    ): Integer; 
    public function ADRGetCloserTemplateForGdPictureImage( 
       ImageID : int
    ) : int;
    public: int ADRGetCloserTemplateForGdPictureImage( 
       int ImageID
    ) 
    public:
    int ADRGetCloserTemplateForGdPictureImage( 
       int ImageID
    ) 

    Parameters

    ImageID
    The GdPicture image.

    Return Value

    The Template ID which has the best similar content to the specified image.
    Example
    Creating two templates and display the name of the template which has the best similar content to an image file.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        // Create a template "A".
        int imageID = gdpictureImaging.CreateGdPictureImageFromFile(@"templateA.jpg");
        int firstTemplateID = gdpictureImaging.ADRCreateTemplateFromGdPictureImage(imageID);
        gdpictureImaging.ADRSetTemplateTag(firstTemplateID, "TemplateA");
        gdpictureImaging.ReleaseGdPictureImage(imageID);
     
        // Create a template "B".
        imageID = gdpictureImaging.CreateGdPictureImageFromFile(@"templateB.jpg");
        int secondTemplateID = gdpictureImaging.ADRCreateTemplateFromGdPictureImage(imageID);
        gdpictureImaging.ADRSetTemplateTag(secondTemplateID, "TemplateB");
        gdpictureImaging.ReleaseGdPictureImage(imageID);
     
        // Identify the template which has the best similar content.
        imageID = gdpictureImaging.CreateGdPictureImageFromFile(@"image.jpg");
        int templateID = gdpictureImaging.ADRGetCloserTemplateForGdPictureImage(imageID);
        gdpictureImaging.ReleaseGdPictureImage(imageID);
        string templateName = gdpictureImaging.ADRGetTemplateTag(templateID);
        MessageBox.Show(templateName, "ADRGetCloserTemplateForGdPictureImage", MessageBoxButtons.OK, MessageBoxIcon.Information);
     
        // Deletes all document identifier templates.
        gdpictureImaging.ADRDeleteTemplate(firstTemplateID);
        gdpictureImaging.ADRDeleteTemplate(secondTemplateID);
    }
    See Also