Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Picture/Barcode recognition/Barcode recognition Web
Function:
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Picture/Barcode recognition/Barcode recognition Web
This example is the version from Thu, 6th Apr 2016.
Project "Barcode recognition Web.rbp"
Class App Inherits WebApplication
End Class
Class Session Inherits WebSession
Const ErrorDialogCancel = "Do Not Send"
Const ErrorDialogMessage = "This application has encountered an error and cannot continue."
Const ErrorDialogQuestion = "Please describe what you were doing right before the error occurred:"
Const ErrorDialogSubmit = "Send"
Const ErrorThankYou = "Thank You"
Const ErrorThankYouMessage = "Your feedback helps us make improvements."
Const NoJavascriptInstructions = "To turn Javascript on, please refer to your browser settings window."
Const NoJavascriptMessage = "Javascript must be enabled to access this page."
End Class
Class WebPage1 Inherits WebPage
Control List Inherits WebListBox
ControlInstance List Inherits WebListBox
End Control
EventHandler Sub Open() test FindFile("barcode1.jpg") test FindFile("barcode2.gif") test FindFile("barcode3.gif") End EventHandler
Function FindFile(name as string) As FolderItem // Look for file in parent folders from executable on dim parent as FolderItem = app.ExecutableFile.Parent while parent<>Nil dim file as FolderItem = parent.Child(name) if file<>Nil and file.Exists then Return file end if parent = parent.Parent wend End Function
Function PictureOpen(f as FolderItem) As Picture dim p as Picture = Picture.Open(f) if p<>Nil then Return p end if dim g as GifMBS = f.OpenAsGIFMBS if g<>Nil then Return g.MakeFirstPictureWithMask end if End Function
Sub test(f as FolderItem) if f.Exists = False then list.AddRow f.name + ": missing" Return end if dim b as new BarcodeScannerMBS 'b.CheckDigits=false 'b.MinimumLength=0 dim p as Picture = PictureOpen(f) if p = nil then list.AddRow f.name + ": can't read" Return end if if b.Scan(p) then list.AddRow f.name + ": " + b.Barcode else list.AddRow f.name + ": failed" end if End Sub
End Class
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Picture Plugin.





Links
MBS FileMaker Plugins