Platforms to show: All Mac Windows Linux Cross-Platform

Back to ZBarMBS class.

ZBarMBS.LibraryLoaded as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Barcode MBS Barcode Plugin 21.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether the library is loaded.

ZBarMBS.LibraryLoadError as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Barcode MBS Barcode Plugin 21.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last error code from loading the zlib library.

ZBarMBS.LibraryLoadErrorMessage as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Barcode MBS Barcode Plugin 21.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The last error message from loading the zlib library.

ZBarMBS.LoadLibrary(file as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Barcode MBS Barcode Plugin 21.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Loads the zbar library.
Example
#If TargetMacOS Then

Const libname = "libzbar.0.dylib"

Dim LibFile As FolderItem = GetFolderItem(libname)

If ZBarMBS.LoadLibrary(LibFile) Then
'MsgBox "ZBar loaded."
Else
MsgBox "Failed to load ZBar library: "+ZBarMBS.LibraryLoadErrorMessage
End If
#EndIf

Please pass path to zbar.dll on Windows, libzbar.dylib on macOS and libzbar.so on Linux.
Returns true on success and false on failure.

See LibraryLoadErrorMessage and LibraryLoadError properties for error details.

We have libraries for you here:
https://www.monkeybreadsoftware.de/xojo/download/plugin/Libs/

See also:

ZBarMBS.LoadLibrary(path as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Barcode MBS Barcode Plugin 21.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Loads the zbar library.
Example
#If TargetLinux Then

Const libname = "libzbar.so.0"
// /usr/lib/x86_64-linux-gnu/libzbar.so.0

If ZBarMBS.LoadLibrary(libname) Then

'MsgBox "ZBar loaded."

Else

MsgBox "Failed to load ZBar library: "+ZBarMBS.LibraryLoadErrorMessage

End If
#endif

Please pass path to zbar.dll on Windows, libzbar.dylib on macOS and libzbar.so on Linux.
Returns true on success and false on failure.

See LibraryLoadErrorMessage and LibraryLoadError properties for error details.

We have libraries for you here:
https://www.monkeybreadsoftware.de/xojo/download/plugin/Libs/

See also:

ZBarMBS.Scan(pic as Picture, AllowedTypes as Integer = 0) as ZBarMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Barcode MBS Barcode Plugin 21.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Performs barcode detection.
Example
// get some picture
Dim p As Picture = Picture.Open(file)
If p <> Nil Then

// scan it
Dim symbols() As ZBarMBS = ZBarMBS.Scan(p)

// show results
For Each symbol As ZBarMBS In symbols
MsgBox symbol.Name+": "+symbol.Text
Next
End If

Returns an array of detected barcodes.

Works best with black & white picture, so you may enhance contrast.
If AllowedTypes is zero, all types are enabled.
Otherwise use bitwiseOr() to combine types you like and pass them as AllowedTypes.

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


The biggest plugin in space...