1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Module 1 :
Public Engine As FREngine.Engine
Private Declare Auto Function GetEngineObject Lib "FREngine.dll" ( _
ByVal devSN As String, _
ByVal opLicPathName As String, _
ByVal opLicPassword As String, _
ByRef engineObj As FREngine.Engine) As Integer
Private Declare Function DeinitializeEngine Lib "FREngine.dll" () As Integer
Public Sub LoadFREngine()
If Not Engine Is Nothing Then Exit Sub
Dim DevSN As String
DevSN = "xxx-xxxx-xxxx"
Dim ret As Integer
ret = GetEngineObject(DevSN, "", "", Engine)
System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(ret)
End Sub
FIN
MAIN
LoadFREngine()
Engine.StartLogging("C:\log.txt", True)
Dim ImageDoc As FREngine.ImageDocument
Dim bcParams As FREngine.BarcodeAnalysisParams
ImageDoc = Engine.PrepareAndOpenImage(chemin_image)
Dim Layout As FREngine.Layout
Layout = Engine.CreateLayout()
bcParams = Engine.CreateBarcodeAnalysisParams()
bcParams.BarcodeParameters.Type = FREngine.BarcodeTypeEnum.BT_Code39
Engine.ExtractBarcodes(ImageDoc, bcParams, Layout)
MsgBox(Layout.TextAsString)
FIN |
Partager