fbritop Well-Known Member Licensed User Longtime User Mar 25, 2022 #1 Hi I was testing [B4XPages] Barcode Reader from: [B4X] [B4XPages] Barcode Reader 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 https://developer.android.com/reference/android/hardware/Camera.Parameters Is it possible to update the barcode reader to work with CamEx2? Thanks FBP
Hi I was testing [B4XPages] Barcode Reader from: [B4X] [B4XPages] Barcode Reader 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 https://developer.android.com/reference/android/hardware/Camera.Parameters Is it possible to update the barcode reader to work with CamEx2? Thanks FBP
Erel B4X founder Staff member Licensed User Longtime User Mar 27, 2022 #2 The Camera library isn't deprecated. You should keep using it. Upvote 0
fbritop Well-Known Member Licensed User Longtime User Mar 27, 2022 #3 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: Copy 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) )) Upvote 0
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: Copy 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) ))
Pedro Caldeira Active Member Licensed User Longtime User May 27, 2022 #4 fbritop said: 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: Copy 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) )) Click to expand... 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() ? Thanks in advance. Upvote 0
fbritop said: 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: Copy 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) )) Click to expand... 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() ? Thanks in advance.
fbritop Well-Known Member Licensed User Longtime User May 27, 2022 #5 Pedro Caldeira said: 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 ? Thanks in advance. Click to expand... Here I attach both classes, one for reading barcodes, and the other for OCR, both of them which I use. Attachments auxClsScannerPPU.bas auxClsScannerPPU.bas 16.4 KB · Views: 612 auxClsScannerQR.bas auxClsScannerQR.bas 16.7 KB · Views: 805 Upvote 0
Pedro Caldeira said: 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 ? Thanks in advance. Click to expand... Here I attach both classes, one for reading barcodes, and the other for OCR, both of them which I use.
Pedro Caldeira Active Member Licensed User Longtime User May 27, 2022 #6 fbritop said: Here I attach both classes, one for reading barcodes, and the other for OCR, both of them which I use. Click to expand... Thanks m8. Upvote 0
fbritop said: Here I attach both classes, one for reading barcodes, and the other for OCR, both of them which I use. Click to expand... Thanks m8.