←Select platform

CreateSingleSelectionField Method

Summary

Creates a new SingleSelectionField with automatically filled out field values recognized by Ocr.

Syntax
C#
VB
C++
public SingleSelectionField CreateSingleSelectionField( 
   List<FormField> formFields, 
   LeadRect bounds, 
   int formPageNumber 
) 
Public Function CreateSingleSelectionField( 
   ByVal formFields As List(Of FormField 
), 
   ByVal bounds As LeadRect, 
   ByVal formPageNumber As Integer) As SingleSelectionField 
public:  
   SingleSelectionField^ CreateSingleSelectionField( 
      List<FormField^>^ formFields, 
      LeadRect^ bounds, 
      Int32 formPageNumber 
   ) 

Parameters

formFields

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

bounds

A LeadRect that represents the location of the SingleSelectionField to be created.

formPageNumber

Master form page number.

Return Value

A SingleSelectionField field with automatically filled out field values.

Remarks

Each field value is filled out with the Ocr text recognized on the right side of the corresponding OmrFormField. If no Ocr text is recognized, the user needs to fill out each SingleField 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 SingleSelectionField. 
public void AddSingleSelectionField() 
{ 
   DiskMasterForm diskMasterForm = GetMasterForm("LeadAnswerSheet_Pattern"); 
   LeadRect bounds = new LeadRect(3160, 3070, 1250, 1240); 
   FormPages formPages = diskMasterForm.ReadFields(); 
   List<FormField> omrFields = GetOmrFields(formPages); 
 
   // Automatically create SingleSelectionField 
   SingleSelectionField singleSelectionField = diskMasterForm.CreateSingleSelectionField(omrFields, bounds, 1); 
 
   formPages.GetPage(1).Add(singleSelectionField); 
 
   // 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 SingleSelectionField. 
Public Sub AddSingleSelectionField() 
   Dim diskMasterForm As DiskMasterForm = GetMasterForm("LeadAnswerSheet_Pattern") 
   Dim bounds As LeadRect = New LeadRect(3160, 3070, 1250, 1240) 
   Dim formPages As FormPages = diskMasterForm.ReadFields() 
   Dim omrFields As List(Of FormField) = GetOmrFields(formPages) 
 
   ' Automatically create SingleSelectionField 
   Dim singleSelectionField As SingleSelectionField = diskMasterForm.CreateSingleSelectionField(omrFields, bounds, 1) 
 
   formPages.GetPage(1).Add(singleSelectionField) 
 
   ' 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