Imports Leadtools
Imports Leadtools.Barcode
Imports Leadtools.Codecs
Imports Leadtools.Forms
Imports Leadtools.Forms.Ocr
Imports Leadtools.Forms.Processing
Imports Leadtools.Forms.Recognition
Imports Leadtools.Forms.Recognition.Barcode
Imports Leadtools.Forms.Recognition.Ocr
'''This method sets the object managers.
Public Sub SetObjectManagers(ByVal recognitionEngine As FormRecognitionEngine, _
ByVal formsOcrEngine As IOcrEngine, _
ByVal formsBarcodeEngine As BarcodeEngine, _
ByVal enableDefault As Boolean, _
ByVal enableOcr As Boolean, _
ByVal enableBarcode As Boolean)
If recognitionEngine Is Nothing Then
Return
End If
If enableDefault Then
Dim defaultObjectManager As DefaultObjectsManager = New DefaultObjectsManager()
recognitionEngine.ObjectsManagers.Add(defaultObjectManager)
End If
If enableOcr Then
Dim ocrObejectManager As OcrObjectsManager = New OcrObjectsManager(formsOcrEngine)
ocrObejectManager.Engine = formsOcrEngine
recognitionEngine.ObjectsManagers.Add(ocrObejectManager)
End If
If enableBarcode Then
Dim barcodeObjectManager As BarcodeObjectsManager = New BarcodeObjectsManager(formsBarcodeEngine)
barcodeObjectManager.Engine = formsBarcodeEngine
recognitionEngine.ObjectsManagers.Add(barcodeObjectManager)
End If
End Sub
using Leadtools;
using Leadtools.Barcode;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Forms.Processing;
using Leadtools.Forms.Recognition;
using Leadtools.Forms.Recognition.Barcode;
using Leadtools.Forms.Recognition.Ocr;
///This method sets the object managers.
public void SetObjectManagers(FormRecognitionEngine recognitionEngine,
IOcrEngine formsOcrEngine,
BarcodeEngine formsBarcodeEngine,
bool enableDefault,
bool enableOcr,
bool enableBarcode)
{
if(recognitionEngine == null)
return;
if(enableDefault)
{
DefaultObjectsManager defaultObjectManager = new DefaultObjectsManager();
recognitionEngine.ObjectsManagers.Add(defaultObjectManager);
}
if(enableOcr)
{
OcrObjectsManager ocrObejectManager = new OcrObjectsManager(formsOcrEngine);
ocrObejectManager.Engine = formsOcrEngine;
recognitionEngine.ObjectsManagers.Add(ocrObejectManager);
}
if(enableBarcode)
{
BarcodeObjectsManager barcodeObjectManager = new BarcodeObjectsManager(formsBarcodeEngine);
barcodeObjectManager.Engine = formsBarcodeEngine;
recognitionEngine.ObjectsManagers.Add(barcodeObjectManager);
}
}