←Select platform

CreateAnswerAreaField Method

Summary

Creates a new OmrAnswerAreaField with automatically filled out field values.

Syntax
C#
VB
C++
Public Function CreateAnswerAreaField( 
   ByVal image As RasterImage, 
   ByVal formFields As List(Of FormField 
), 
   ByVal bounds As LeadRect, 
   ByVal formPageNumber As Integer) As OmrAnswerAreaField 
public:  
   OmrAnswerAreaField^ CreateAnswerAreaField( 
      RasterImage^ image, 
      List<FormField^>^ formFields, 
      LeadRect^ bounds, 
      Int32 formPageNumber 
   ) 

Parameters

image

The master form image.

formFields

A FormField list that contains all fields, including the OmrFormField fields within the bounds.

bounds

A LogicalRectangle represents the location of the OmrAnswerAreaField to be created.

formPageNumber

Master form page number.

Return Value

A OmrAnswerAreaField field with automatically filled out field values.

Remarks

If the column count is 4 or 5 the field values are filled with alphabets from A to D or A to E respectively. Otherwise, numerical values will be used for Omr field value.

Example
C#
VB
using Leadtools; 
using Leadtools.Ocr; 
using Leadtools.Forms.Common; 
using Leadtools.Forms.Processing; 
using Leadtools.Forms.Auto; 
using Leadtools.Codecs; 
 
///This example shows how to create a OmrAnswerAreaField. 
public void AddOmrAnswerAreaField() 
{ 
   DiskMasterForm diskMasterForm = GetMasterForm("LeadAnswerSheet"); 
   LeadRect bounds = new LeadRect(240, 975, 390, 1925); 
   FormPages formPages = diskMasterForm.ReadFields(); 
   List<FormField> omrFields = GetOmrFields(formPages); 
 
   // Automatically create OmrAnswerAreaField 
   OmrAnswerAreaField omrAnswerAreaField = diskMasterForm.CreateAnswerAreaField(diskMasterForm.ReadForm(), omrFields, bounds, 1); 
 
   // Set field name 
   omrAnswerAreaField.Name = "AnswerArea 1-25"; 
 
   formPages.GetPage(1).Add(omrAnswerAreaField); 
 
   // Write fields to master form 
   diskMasterForm.WriteFields(formPages); 
} 
Imports Leadtools 
Imports Leadtools.Ocr 
Imports Leadtools.Forms.Common 
Imports Leadtools.Forms.Processing 
Imports Leadtools.Forms.Auto 
Imports Leadtools.Codecs 
 
''' This example shows how to create a OmrAnswerAreaField. 
Public Sub AddOmrAnswerAreaField() 
   Dim diskMasterForm As DiskMasterForm = GetMasterForm("LeadAnswerSheet") 
   Dim bounds As LeadRect = New LeadRect(240, 975, 390, 1925) 
   Dim formPages As FormPages = diskMasterForm.ReadFields() 
   Dim omrFields As List(Of FormField) = GetOmrFields(formPages) 
 
   ' Automatically create OmrAnswerAreaField 
   Dim omrAnswerAreaField As OmrAnswerAreaField = diskMasterForm.CreateAnswerAreaField(diskMasterForm.ReadForm(), omrFields, bounds, 1) 
 
   ' Set field name 
   omrAnswerAreaField.Name = "AnswerArea 1-25" 
   formPages.GetPage(1).Add(omrAnswerAreaField) 
 
   ' Write fields to master form 
   diskMasterForm.WriteFields(formPages) 
End Sub 

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.Auto Assembly