Support for determining the various zone types, recognition modules and fill methods supported by the OCR engine.
Syntax
Visual Basic (Declaration) | |
---|
Public Interface IOcrZoneManager |
C# | |
---|
public interface IOcrZoneManager |
C++/CLI | |
---|
public interface class IOcrZoneManager |
Example
This example will show the different zone types, recognition modules and fill types supported by the Plus OCR engine.
Visual Basic | Copy Code |
---|
Public Sub ZoneManagerExample()
RasterSupport.Unlock(RasterSupportType.Document, "Replace with your own key here")
RasterSupport.Unlock(RasterSupportType.OcrPlus, "Replace with your own key here")
RasterSupport.Unlock(RasterSupportType.OcrPlusPdfLeadOutput, "Replace with your own key here")
Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, False)
ocrEngine.Startup(Nothing, Nothing, Nothing, Nothing)
Dim ocrZoneManager As IOcrZoneManager = ocrEngine.ZoneManager
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
Console.WriteLine("Hit enter to show the supported recognition modules")
Console.ReadLine()
Dim recognitionModules() As OcrZoneRecognitionModule = ocrZoneManager.GetSupportedRecognitionModules()
Console.WriteLine("Supported recognition modules:")
Console.WriteLine("---------------------")
For Each recognitionModule As OcrZoneRecognitionModule In recognitionModules
Console.WriteLine(" {0}", recognitionModule)
Next
Console.WriteLine("Hit enter to show the supported fill methods")
Console.ReadLine()
Dim fillMethods() As OcrZoneFillMethod = ocrZoneManager.GetSupportedFillMethods()
Console.WriteLine("Supported fillMethods:")
Console.WriteLine("---------------------")
For Each fillMethod As OcrZoneFillMethod In fillMethods
Console.WriteLine(" {0}", fillMethod)
Next
ocrEngine.Shutdown()
End Using
End Sub |
C# | Copy Code |
---|
public void ZoneManagerExample() { // Unlock the support needed for LEADTOOLS Plus OCR engine RasterSupport.Unlock(RasterSupportType.Document, "Replace with your own key here"); RasterSupport.Unlock(RasterSupportType.OcrPlus, "Replace with your own key here"); RasterSupport.Unlock(RasterSupportType.OcrPlusPdfLeadOutput, "Replace with your own key here"); // Create an instance of the engine using(IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, false)) { // Start the engine using default parameters ocrEngine.Startup(null, null, null, null); // 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); Console.WriteLine("Hit enter to show the supported recognition modules"); Console.ReadLine(); OcrZoneRecognitionModule[] recognitionModules = ocrZoneManager.GetSupportedRecognitionModules(); Console.WriteLine("Supported recognition modules:"); Console.WriteLine("---------------------"); foreach(OcrZoneRecognitionModule recognitionModule in recognitionModules) Console.WriteLine(" {0}", recognitionModule); Console.WriteLine("Hit enter to show the supported fill methods"); Console.ReadLine(); OcrZoneFillMethod[] fillMethods = ocrZoneManager.GetSupportedFillMethods(); Console.WriteLine("Supported fillMethods:"); Console.WriteLine("---------------------"); foreach(OcrZoneFillMethod fillMethod in fillMethods) Console.WriteLine(" {0}", fillMethod); // Shutdown the engine // Note: calling Dispose will also automatically shutdown the engine if it has been started ocrEngine.Shutdown(); } } |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family
See Also