Skip to content
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

Still can't figure out how to change aspect ratio! #34

Open
lectricas opened this issue Aug 17, 2023 · 1 comment
Open

Still can't figure out how to change aspect ratio! #34

lectricas opened this issue Aug 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@lectricas
Copy link

Hi. There are two options we have from camerax that allow us to change aspect ration:

Preview preview = new Preview.Builder()
            .setTargetAspectRatio(AspectRatio.RATIO_4_3)
            .build();
ImageCapture imageCapture = new ImageCapture.Builder()
            .setTargetAspectRatio(AspectRatio.RATIO_4_3)
            .build();

The first one change the viewfinder ration, the second one changes the output picture ratio.
Can I change aspect ratio only for ImageCapture and not for preview?

What code should I write to change aspect ration in both cases?

I haven't found any setTargetAspectRatio lines inside library code.

@lectricas
Copy link
Author

Also, doing this:

CameraPreview(
        imageCaptureTargetSize = remember { ImageTargetSize(AspectRatio.RATIO_4_3) },

has no effect.

Output image ratio is still 2_1 as my phone screen is really long and thin.

@ujizin ujizin added the bug Something isn't working label Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants