B4A + B4i barcode reader. Don't miss: - #PlistExtra in B4i. - Manifest code + #AdditionalJar in B4A Depends on BCToast: https://www.b4x.com/android/forum/threads/b4x-bctoast-cross-platform-custom-toast-message.111046/#content (BCToast will be an internal library in the near future) While the...
www.b4x.com
I could not get to enable/disable the flash, because I understand Camera library methods are deprecated according to Google
SetFlashMode does not work on Camera class, but do operates ok from Camera2.I finaly manage to adapt the Barcode Reader to Camera2 class, having a timer to scan every 100ms and changing the frameBuilder to setBitmap:
B4X:
Dim frameBuilder As JavaObject
frameBuilder.InitializeNewInstance("com/google/android/gms/vision/Frame.Builder".Replace("/", "."), Null)
frameBuilder.runmethod("setBitmap", Array( camEx.GetPreviewBitmap(pnlPreview.Width, pnlPreview.Height) ))
SetFlashMode does not work on Camera class, but do operates ok from Camera2.I finaly manage to adapt the Barcode Reader to Camera2 class, having a timer to scan every 100ms and changing the frameBuilder to setBitmap:
B4X:
Dim frameBuilder As JavaObject
frameBuilder.InitializeNewInstance("com/google/android/gms/vision/Frame.Builder".Replace("/", "."), Null)
frameBuilder.runmethod("setBitmap", Array( camEx.GetPreviewBitmap(pnlPreview.Width, pnlPreview.Height) ))
Hello @fbritop I am using the Camera and CameraExClass with BarcodeScanner but need to change to camera2 and CamEx2, since I am already using these late modules in the app to take pictures. How did you adapted the barcode class, since we no longer have ScanCamera_preview event in CamEx2 ?
A timer to call the previous code that was in ScanCamera_preview ? and how to you use a bitmap instead of the data() ?
Hello @fbritop I am using the Camera and CameraExClass with BarcodeScanner but need to change to camera2 and CamEx2, since I am already using these late modules in the app to take pictures. How did you adapted the barcode class, since we no longer have ScanCamera_preview event in CamEx2 ?
A timer, how ?