←Select platform

BankCheckFieldType Enumeration

Represents the type of field.
public enum BankCheckFieldType  
Public Enum BankCheckFieldType  
public final class BankCheckFieldType 
    extends java.lang.Enum<BankCheckFieldType> 
public enum class BankCheckFieldType  
0None Not a field. When the state of processing is Start or Finish, then the BankCheckFieldType is set to BankCheckFieldType.None.
1Micr Micr field.
2Date Date field.
3Amount Amount field.
4Name Name field.
5Signature Signature field.

The BankCheckFieldType is used in the ProgressEventArgs to show the type of field.

using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Ocr; 
using Leadtools.Forms.Commands; 
public void TestBankCheckReader() 
   // Initialize the RasterCodecs class 
   RasterCodecs codecs = new RasterCodecs(); 
   // Initialize the BankCheckReader class 
   BankCheckReader checkReader = new BankCheckReader(); 
   // The bank cheque image 
   string chequePath = Path.Combine(LEAD_VARS.ImagesDir, "BankCheck.jpg"); 
   RasterImage image = codecs.Load(chequePath); 
   IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD); 
   ocrEngine.Startup(codecs, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
   // Assign Engine to Reader 
   checkReader.OcrEngine = ocrEngine; 
   //Set MICR code type 
   checkReader.MicrFontType = BankCheckMicrFontType.E13b; 
   // handle Process Event 
   checkReader.Process += new EventHandler<ProgressEventArgs>(reader_Processed); 
   // Process Image 
void reader_Processed(object sender, ProgressEventArgs e) 
   Console.WriteLine(string.Format("State      : {0}%", e.State)); 
   Console.WriteLine(string.Format("Percentage : {0}%", e.Percentage)); 
   Console.WriteLine(string.Format("FieldType  : {0}%", e.FieldType.ToString())); 
   if (e.State == ProcessState.Finish) 
      BankCheckReader reader = sender as BankCheckReader; 
      foreach (var value in reader.Results) 
         LeadRect bounds = value.Value.Bounds; 
         Console.WriteLine(string.Format("Field Name      : {0}", value.Key)); 
         Console.WriteLine(string.Format("Field Value     : {0}", value.Value.Text)); 
         Console.WriteLine(string.Format("Field Bounds    : {0},{0},{0},{0}", bounds.X.ToString(), bounds.Y.ToString(), bounds.Width.ToString(), bounds.Height.ToString())); 
static class LEAD_VARS 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
   public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime"; 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.Forms.Common 
Imports Leadtools.Ocr 
Imports Leadtools.Forms.Commands 
Public Sub TestBankCheckReader() 
   ' Initialize the RasterCodecs class 
   Dim codecs As New RasterCodecs() 
   ' Initialize the BankCheckReader class 
   Dim checkReader As New BankCheckReader() 
   ' The bank check image 
   Dim chequePath As String = Path.Combine(LEAD_VARS.ImagesDir, "BankCheck.jpg") 
   Dim image As RasterImage = codecs.Load(chequePath) 
   Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD) 
      ocrEngine.Startup(Nothing, Nothing, Nothing, "C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime") 
      ' Assign Engine to Reader 
      checkReader.OcrEngine = ocrEngine 
      ' handle Process Event 
      AddHandler checkReader.Process, AddressOf reader_Processed 
      ' Process Image 
   End Using 
End Sub 
Private Sub reader_Processed(sender As Object, e As ProgressEventArgs) 
   Console.WriteLine(String.Format("State      : {0}%", e.State)) 
   Console.WriteLine(String.Format("Percentage : {0}%", e.Percentage)) 
   Console.WriteLine(String.Format("FieldType  : {0}%", e.FieldType.ToString())) 
   If e.State = ProcessState.Finish Then 
      Dim reader As BankCheckReader = TryCast(sender, BankCheckReader) 
      If reader IsNot Nothing Then 
         For Each value As KeyValuePair(Of String, BankCheckField) In reader.Results 
            Dim bounds As LeadRect = value.Value.Bounds 
            Console.WriteLine(String.Format("Field Name      : {0}", value.Key)) 
            Console.WriteLine(String.Format("Field Value     : {0}", value.Value.Text)) 
            Console.WriteLine(String.Format("Field Bounds    : {0},{0},{0},{0}", bounds.X.ToString(), bounds.Y.ToString(), bounds.Width.ToString(), bounds.Height.ToString())) 
      End If 
   End If 
End Sub 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\LEADTOOLS22\Resources\Images" 
End Class 

Target Platforms

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

Leadtools.Forms.Commands Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.