Camera in Android, how to get best size, preview size, picture size, view size, image distorted

后端 未结 3 1364
不思量自难忘°
不思量自难忘° 2020-11-30 02:16

having image distorted when mixing a view from OpenGL and the Android camera to get an image of both when using the takepicture method. I checked and found that the camera

3条回答
  •  渐次进展
    2020-11-30 02:52

    Possible algorithm:

    1) get output area aspect ratio (=width/height)

    2) iterate through supported sizes:

    Choose biggest one with close aspect ratio(+-5%, for example) If nothing close or resolution too low - just make yor surface(that you draw frames to) be same aspect ratio as biggest supported size and center it in parent view

    Howewer, there are preview sizes & picture sizes. If you wish them to have same aspect ratio - then better choice is to use selected picture size aspect ratio in 1) This way you'll probably have to center your surface in parent view

    Hope that helps)

提交回复
热议问题