Android Resizing Camera Preview

梦想与她 提交于 2020-01-03 01:53:08

问题


Is there anyway to show the camera preview in an unsupported preview size?

The app I'm making requires an image size of 800x480 but the preview needs to be 480x800. Is there anyway to do this? When I try changing the parameters the image gets squashed and stretched in the preview.


回答1:


You can only use supported preview sizes.

use:

Parameters params = myCamera.getParameters();

List<Size> previewsizes = params.getSupportedPreviewSizes();

Pick a preview size that is the closest to what you want and use that.
It's as close as you can get.



来源:https://stackoverflow.com/questions/6545533/android-resizing-camera-preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!