Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

[WD 21]C# or VB Syntax in Windev (2 replies)

$
0
0
Hi

I apologise for asking so many questions lately but here goes again.

I am trying to incorporate Leadtools OCR and scanning in Windev. Loaded all the .NET assemblies I need and just trying a simple example.

This is the example code in C#

formsCodec = new RasterCodecs();

ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(formsCodec, null, null, @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime");

//Point repository to directory with existing master forms
formsRepository = new DiskMasterFormsRepository(formsCodec, @"C:\Users\Public\Documents\LEADTOOLS Images\Forms\MasterForm Sets\OCR");
autoEngine = new AutoFormsEngine(formsRepository, ocrEngine, null, AutoFormsRecognitionManager.Default | AutoFormsRecognitionManager.Ocr, 30, 80, true);

What I'm not sure of is how to do this in Windev for instance:

formsCodec must be something i.e this works;

FormsCodec is RasterCodecs = new RasterCodecs() does not give an error in Windev

but

OcrEngine is OcrEngineManager = new OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False) does not work.

It seems in C# you just create a variable but in windev we have to declare what type of variable and this is where I fall short.

In VB it look like this:

Dim MY_LICENSE_FILE As String = "d:\temp\TestLic.lic"
' Unlock LEADTOOLS special Support
Dim MY_DEVELOPER_KEY As String = "abc123xyz"
RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY)

formsCodec = New RasterCodecs()
' Create an OCR Engine for each processor on the machine. This allows for optimal use of thread during recognition and processing.
ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, False)
ocrEngine.Startup(formsCodec, Nothing, Nothing, "C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime")

' Point repository to directory with existing master forms
formsRepository = New DiskMasterFormsRepository(formsCodec, "C:\Users\Public\Documents\LEADTOOLS Images\Forms\MasterForm Sets\OCR")
autoEngine = New AutoFormsEngine(formsRepository, ocrEngine, Nothing, AutoFormsRecognitionManager.Default Or AutoFormsRecognitionManager.Ocr, 30, 80, True)



Thanks in advance



Ericus Steyn

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>