#Region Project Attributes
#ApplicationLabel: b4aOCRComplete
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#MultiDex: True
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: ..\OCRCompleteRes
'#AdditionalRes: C:\Users\----------2\Documents\Basic 4 Android\JOHAN APPS\JHS LIBS\resource\b4a_appcompat, de.amberhome.objects.appcompat
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\google\google-play-services\libproject\google-play-services_lib\res, com.google.android.gms
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\design\res, android.support.design
'#ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby
'#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .gcm, .maps, .panorama
'#Extends: android.support.v7.app.AppCompatActivity
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Button1 As Button
Dim avocr As OCRReaderComplete
Private CheckBox1 As CheckBox
Private CheckBox2 As CheckBox
' Dim myfont As Typeface
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
avocr.Initialize("avocr")
' myfont = Typeface.LoadFromAssets("digital-7.ttf")
' avocr.OCRtypeFace = myfont
avocr.OCRtextColor = Colors.Red 'the color of the text while OCR takes place
avocr.OCRtextSize = 35.0 'the size of the text while OCR take place
avocr.OCRrectangleColor = Colors.Green
avocr.OCRrectangleWidth = 2.0
avocr.TTSActive = False 'TTS active or not
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
If CheckBox1.Checked = True Then
avocr.UseFlash = True
Else
avocr.UseFlash = False
End If
If CheckBox2.Checked = True Then
avocr.UseAutoFocus = True
Else
avocr.UseAutoFocus = False
End If
avocr.StartOCRReader
End Sub
Sub avocr_selected_text_result(result As String)
Label1.Text = ""
Label1.Text = result 'handle the result text returned
End Sub