I am attaching a component to replace JcustomCam . In Android 14, I was unable to get a preview image with it.
The new component will be registered in Android Bridges Extras. The base of the component is ZbarcodeScannerView .
Note : It is customized for my project and does what I need perfectly. But of course it can be improved in several aspects to meet each person's needs.
The zip file contains all the files to be placed in the corresponding folders of your LAMW. Don't forget to back up what is affected in case there are problems.
I have tested enough to make sure there are no errors. Clean installations of the component mainly.
I hope it is useful. Using the device's camera is not always ideal. It depends on each app.
In case of errors, I can try to help.
If JmPessoa gets the time, I'm sure he'll be able to make it a perfect component.
https://youtu.be/G8Z5hPhfF18 UPDATE I made a change: I deleted the Scan (bitmap) method and inserted the TakePicture ( _filename) method.
How to use it?
After granting permission to the camera...
// Initialize the camera
ZCamView1.Scan();
// take picture .... attention...filename without extension
Zcamview1.TakePicture('filename');
// fullpath from picture is obtained in codedata ... Just ignore codeformat
ZCamView1ScannerResult(Sender: TObject;
codedata: string; codeformat: TBarcodeFormat);
Remember that I modified an existing component ( ZbarcodeScannerView). Feel free to remove the remnants of it.
Suggestion for use with floating buttons... Flash and Take Picture
Caution: included the lamwdesigner.pas unit
Without it, it will be impossible to change any property related to the component's Layout (Anchor, LayoutParam, etc.)
Make sure to compile lazandroidwizardpack.lpk and tfpandroidbridge_pack.lpk for the changes to take effect.