-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ho to set Zoom in Camera using Zxing #728
Comments
I also need this information |
Can someone answer? |
If you are using something like BarcodeView, extend it and implement CameraPreview.StateListener, CameraParametersCallback. Then in the constructors, after calling the super, call addStateListener(this) In the override for previewStarted(), call changeCameraParameters(this). That will pass the callback down to the CameraManager which will then get called to set the desired parameters public Camera.Parameters changeCameraParameters(Camera.Parameters params) { setZoom() uses an index into the available zooms list which you can get from Camera.Parameters if you want to see what values you are dealing with. A Galaxy S22 goes up to 8x, so getMaxZoom() / 2 is about 4x (Note: BarcodeView doesn't need to implement CameraPreview.StateListener since it has it's own previewStarted function that you can override, but other components you are extending may not have that helper) |
Kotlin example:
where zoomLevel is a Float parameter. |
I want to set Zoom in Camera but not able achieve this using Zxing, please suggest any solution.
I'm currently using following version :
The text was updated successfully, but these errors were encountered: