My question is very simple:
How to get an Android
android.hardware.Camera2
with 1:1 ratio and without deformation like Instagram?
I tested with the GoogeSamples project android-Camera2Basic. But when I change the preview with a ratio of 1:1 image is deformed. Does anyone have an idea on this?
For anybody looking for this, I tried the above answer. Adding a margin to hide part of textureview to make it look square looks good in preview. But when saving the image, you should remove the hidden areas from the output image also.
An Easier solution is to show a full textureview and to overlay some other layouts on it to make it look square.You can easily crop the image from output.
you can find the sample code here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With