简体   繁体   中英

How to set different aspect ratio for CameraX in android

I am not able to find a solution for how to set different aspect ratio for a camerax I want the user to be able to click the photo in 1:1 4:3 16:9

Android camera does not always support all aspect ratios. For example, 1:1 is not always supported. However, you can crop the camera output to achieve the same effect.

Without knowing what you are trying to accomplish, I suggest you starting with the ViewPort API , where you can customize a aspect ratio at the ViewPort.Builder() constructor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM