←Select platform

IOcrZoneManager Interface

Summary

Support for determining the various zone types, recognition modules and fill methods supported by the OCR engine.

Syntax

C#
VB
Java
Objective-C
C++
public interface IOcrZoneManager 
Public Interface IOcrZoneManager  
@interface LTOcrZoneManager : NSObject 
public class OcrZoneManager 
public interface class IOcrZoneManager  

Remarks

You can access the instance of the IOcrZoneManager used by an IOcrEngine through the IOcrEngine.ZoneManager property.

When calling the IOcrPage.AutoZone method on a page, the generated zone's type (OcrZone.ZoneType) will always be one of the supported values as reported by the IOcrZoneManager.

Before manually changing any of the above zone properties, you must determine whether the particular value is supported by this instance of IOcrEngine by using IsZoneTypeSupported first.

To get all the supported zone types use GetSupportedZoneTypes.

Example

This example will show the different zone types supported by the LEADTOOLS OCR Module - LEAD Engine.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Ocr; 
using Leadtools.Forms.Common; 
using Leadtools.Document.Writer; 
using Leadtools.WinForms; 
 
public void ZoneManagerExample() 
{ 
   // Create an instance of the engine 
   using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false)) 
   { 
      // Start the engine using default parameters 
      ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
 
      // Get the zone manager 
      IOcrZoneManager ocrZoneManager = ocrEngine.ZoneManager; 
 
      // Show all the zone types supported by this engine 
      Console.WriteLine("Hit enter to show the supported zone types"); 
      //Console.ReadLine(); 
 
      OcrZoneType[] zoneTypes = ocrZoneManager.GetSupportedZoneTypes(); 
      Console.WriteLine("Supported zone types:"); 
      Console.WriteLine("---------------------"); 
      foreach (OcrZoneType zoneType in zoneTypes) 
         Console.WriteLine("  {0}", zoneType); 
 
      // Shutdown the engine 
      // Note: calling Dispose will also automatically shutdown the engine if it has been started 
      ocrEngine.Shutdown(); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS 20\Bin\Common\OcrLEADRuntime"; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.Ocr 
Imports Leadtools.Forms 
Imports Leadtools.Document.Writer 
Imports Leadtools.WinForms 
 
Public Sub ZoneManagerExample() 
   ' Create an instance of the engine 
   Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, False) 
      ' Start the engine using default parameters 
      ocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrLEADRuntimeDir) 
 
      ' Get the zone manager 
      Dim ocrZoneManager As IOcrZoneManager = ocrEngine.ZoneManager 
 
      ' Show all the zone types supported by this engine 
      Console.WriteLine("Hit enter to show the supported zone types") 
      Console.ReadLine() 
 
      Dim zoneTypes As OcrZoneType() = ocrZoneManager.GetSupportedZoneTypes() 
      Console.WriteLine("Supported zone types:") 
      Console.WriteLine("---------------------") 
      For Each zoneType As OcrZoneType In zoneTypes 
         Console.WriteLine("  {0}", zoneType) 
      Next 
 
      ' Shutdown the engine 
      ' Note: calling Dispose will also automatically shutdown the engine if it has been started 
      ocrEngine.Shutdown() 
   End Using 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const OcrLEADRuntimeDir As String = "C:\LEADTOOLS 20\Bin\Common\OcrLEADRuntime" 
End Class 

Requirements

Target Platforms

Help Version 20.0.2018.1.18
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Ocr Assembly