←Select platform

GetSupportedZoneTypes Method

Summary
Gets a list of zone types supported by this IOcrEngine.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public OcrZoneType[] GetSupportedZoneTypes() 
@property (nonatomic, copy, readonly) NSArray<NSNumber *> *supportedZoneTypes; 
public ArrayList<OcrZoneType> getSupportedZoneTypes() 
array<OcrZoneType>^ GetSupportedZoneTypes();  
def GetSupportedZoneTypes(self): 

Return Value

An array of OcrZoneType members that list the zone types supported by this IOcrEngine.

Remarks

To determine whether a particular zone type is supported by the engine, use IsZoneTypeSupported.

Example
C#
Java
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)) 
   { 
      // 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:\LEADTOOLS23\Bin\Common\OcrLEADRuntime"; 
} 
 
import static org.junit.Assert.assertTrue; 
 
import java.io.File; 
import java.io.IOException; 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.ocr.*; 
import leadtools.document.writer.*; 
 
 
public void IOcrZoneManagerExample() { 
   final String OCR_LEAD_RUNTIME_DIR = "C:\\LEADTOOLS23\\Bin\\Common\\OcrLEADRuntime"; 
 
   // Create an instance of the engine 
   OcrEngine ocrEngine = OcrEngineManager.createEngine(OcrEngineType.LEAD); 
 
   // Start the engine using default parameters 
   ocrEngine.startup(null, null, null, OCR_LEAD_RUNTIME_DIR); 
   assertTrue(ocrEngine.isStarted()); 
 
   // Get the zone manager 
   OcrZoneManager ocrZoneManager = ocrEngine.getZoneManager(); 
 
   // Show all the zone types supported by this engine 
   System.out.println("Hit enter to show the supported zone types"); 
 
   OcrZoneType[] zoneTypes = ocrZoneManager.getSupportedZoneTypes(); 
   System.out.println("Supported zone types:"); 
   System.out.println("---------------------"); 
   for (OcrZoneType zoneType : zoneTypes) 
      System.out.printf("  %s", zoneType); 
 
   // Shutdown the engine 
   // Note: calling Dispose will also automatically shutdown the engine if it has 
   // been started 
   ocrEngine.dispose(); 
 
   assertTrue("Length of zone type is not expected value", zoneTypes.length == 11); 
} 
Requirements

Target Platforms

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

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