-
Notifications
You must be signed in to change notification settings - Fork 407
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
Best practice for showing full uncropped sensor in CameraView? #53
Comments
If you want to display the full uncropped preview, then the preview size must have the same aspect ratio with the photo aspect ratio. That's right. Personally I have not tried this myself to know the edge cases and cannot think of any right now. What have you encountered with this approach? |
Currently, the camera view is resized to make sure that the smallest side of the camera frame matches the smallest side of the view. That is to make sure that there won't be any blank lines on the screen. We can add an option to fit camera preview inside of the view, but that would introduce blank lines mentioned above. To be sure that we understand the problem correctly, could you please provide us some screenshots? |
I believe the cleanest solution is to have a parameter in the builder to allow you choose if you want the preview to be cropped or be full size. Like:
|
@andrewcking functionality has been add in 1.2.0. You can now simply add this to your builder: This would solve your needs. Let us know! |
I am curious to know if there is a simple solution that I am overlooking (there probably is, I am not yet great with layouts). I am wanting my cameraView to show the full uncropped sensor. I was thinking that the following would work in my layout:
But it is still cropping to fill the screen. I worked out a solution by programmatically setting the width to the screen width, getting the biggest size photo parameter, figuring out the aspect ratio from that parameter and then setting the view height based on the calculated aspect ratio. I feel like this should work for most purposes but there may be edge cases where this breaks. What is the best practice for showing the full uncropped camera preview? Thank you for this amazing library, it has been extremely helpful to me and has been great to work with.
The text was updated successfully, but these errors were encountered: