We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
环境信息
问题描述
package com.zxing.camera;
... ...
final class CameraConfigurationManager { ... ... private static Point findBestPreviewSizeValue(CharSequence previewSizeValueString, Point screenResolution) { ... ... int newDiff = Math.abs(newX - screenResolution.x) + Math.abs(newY - screenResolution.y); if (newDiff == 0) { bestX = newX; bestY = newY; break; } else if (newDiff < diff) { if((3 * newX) == (4 * newY)) { bestX = newX; bestY = newY; diff = newDiff; } } ... ...
加粗代码并没有解决拍照预览图像拉伸问题。
我将这段代码替换成如下代码,发现图像不会拉伸变形,但是未在其他型号手机上测试。
float current_rate = (float) Math.max(newX, newY)/ (float)Math.min(newX, newY); tmp_diff = Math.abs(current_rate-rate); if( min_diff < 0){ min_diff = tmp_diff ; bestX = newX; bestY = newY; } if( tmp_diff < min_diff ){ min_diff = tmp_diff ; bestX = newX; bestY = newY; }
The text was updated successfully, but these errors were encountered:
赞,感谢反馈。 可以提交一个 Pull Request 来贡献下代码哦,非常感谢~ https://github.com/Tencent/APIJSON/blob/master/CONTRIBUTING.md#pull-request
Sorry, something went wrong.
No branches or pull requests
环境信息
问题描述
package com.zxing.camera;
... ...
final class CameraConfigurationManager {
... ...
private static Point findBestPreviewSizeValue(CharSequence previewSizeValueString, Point screenResolution) {
... ...
int newDiff = Math.abs(newX - screenResolution.x) + Math.abs(newY - screenResolution.y);
if (newDiff == 0) {
bestX = newX;
bestY = newY;
break;
} else if (newDiff < diff) {
if((3 * newX) == (4 * newY)) {
bestX = newX;
bestY = newY;
diff = newDiff;
}
}
... ...
加粗代码并没有解决拍照预览图像拉伸问题。
我将这段代码替换成如下代码,发现图像不会拉伸变形,但是未在其他型号手机上测试。
float current_rate = (float) Math.max(newX, newY)/ (float)Math.min(newX, newY);
tmp_diff = Math.abs(current_rate-rate);
if( min_diff < 0){
min_diff = tmp_diff ;
bestX = newX;
bestY = newY;
}
if( tmp_diff < min_diff ){
min_diff = tmp_diff ;
bestX = newX;
bestY = newY;
}
The text was updated successfully, but these errors were encountered: