本文主要是介绍Zxing图片拉伸解决 Android 二维码扫描,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
竖屏导致图片垂直方向压缩变形
Point screenResolutionForCamera = new Point();
screenResolutionForCamera.x = screenResolution.x;
screenResolutionForCamera.y = screenResolution.y;
// preview size is always something like 480*320, other 320*480
if (screenResolution.x < screenResolution.y) {
screenResolutionForCamera.x = screenResolution.y;
screenResolutionForCamera.y = screenResolution.x;
}
在把其后的
cameraResolution = getCameraResolution(parameters, screenResolution);
中的screenResolution改为 screenResolutionForCamera
如下:
cameraResolution = getCameraResolution(parameters, screenResolutionForCamera);
这篇关于Zxing图片拉伸解决 Android 二维码扫描的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!