由于某些原因,当我使用相机 setPictureSize 时,相机预览会失真。有人遇到过这个问题吗?
1 回答
According to my experience there is a dependency between setPictureSize and camera preview size.
Most of tutorials like official (http://developer.android.com/reference/android/hardware/Camera.html) calculates preview size depending on actual screen size. But this won't work with actual picture size. So I now calculate optimal preview size according to selected picture size.
I would recommend to look at Android camera source code of Android 2.3 that is not so complicated: https://android.googlesource.com/platform/packages/apps/Camera.git/+/android-cts-2.3_r12