←Select platform

ITemplateForm Interface

Summary

Represents a template form in the LEADTOOLS OMR toolkit. The interface provides methods for reading and writing template form recognition attributes, processing fields, and images.

Syntax
C#
VB
C++
Java
public interface ITemplateForm : IForm 
public interface ITemplateForm 
    extends IForm 
Public Interface ITemplateForm 
   Inherits IForm 
public: 
   interface class ITemplateForm abstract : IForm 

Remarks

Each OMR form consists of a page or multiple pages of OMR sheets. There are two types of forms: the ITemplateForm and the IRecognitionForm form.

The ITemplateForm object represents the empty OMR sheets. After adding a page to the template form, LEADTOOLS OMR toolkit auto-detects the OMR bubbles in the form and saves the form attributes internally. The LEADTOOLS OMR toolkit facilitates saving and loading these attributes in binary formatted data to or from a standard .NET Stream provided by the user.

After creating the processing fields, call ITemplateForm.ExtractInfo to populate the fields with the detected OMR bubbles within the specified area.

IRecognitionForm objects are used for the filled-in forms that have the same page layout as the ITemplateForm. During recognition and processing, the LEADTOOLS OMR toolkit automatically aligns the IRecognitionForm images with the corresponding ITemplateForm objects and processes the fields provided in the ITemplateForm in the filled-in images.

To create an ITemplateForm object, call the OmrEngine.CreateTemplateForm method.

Example

The following example is a snippet of a larger example project. To run the larger example project, follow the work flow laid out in the OMREngine example. You can also download the complete example in Visual Studio 2017.

C#
using Leadtools.Barcode; 
using Leadtools.Codecs; 
using Leadtools.Forms.Processing.Omr; 
using Leadtools.Ocr; 
 
public static void SaveTemplateToDisk(ITemplateForm template) 
{ 
   using (FileStream fs = new FileStream(Path.Combine(LEAD_VARS.ImagesDir, @"Forms\OMR Processing\Exam\exam-example-template.tdd"), FileMode.Create)) 
   { 
      template.Save(fs); 
 
      fs.Close(); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; 
} 

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Processing.Omr Assembly