相关疑难解决方法(0)

Android:支持的相机预览尺寸是错误的宽高比

解决方案:我实际上并没有设置相机预览,而是缩放它附带的默认预览.您需要将参数分配回相机,因为 _camera.getParamters.setPreviewSize() 不起作用!

我正在努力让Android相机在手机上预览(理想情况下是全屏).

然而,我遇到了一种情况,我觉得硬件和软件都在密谋反对我:/

我得到了相机支持的屏幕尺寸列表.对于一半的手机(我的12个设备中的大约6个),当我将预览匹配设置为最接近屏幕的预览时,这可以正常工作.

但是在另一半,预览被拉伸和倾斜.有许多帖子存在并声称要解决这个问题,但没有.

The reason I am finding is this: the list of supported camera screen sizes that I am getting from the hardware itself is wrong. Why? Because when manually set the camera up to one of its highest supported sizes the aspect ratio is still off:

_camera.getParameters().setPreviewSize(720,1280);
getHolder().setFixedSize(720, 1280);
Run Code Online (Sandbox Code Playgroud)

For this phone, the screen size is 768 x 1280. The closest supported screen size is 720 x 1280. Setting it to this …

android surfaceview android-camera

6
推荐指数
0
解决办法
3353
查看次数

标签 统计

android ×1

android-camera ×1

surfaceview ×1