You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我的平板是1920x1200的分辨率,竖屏,摄像头为500w像素,通过Camera.Parameters.getSupportedPreviewSizes()获取支持的预览尺寸,发现最大为1280x768,远小于1920x1200,这样的话就会导致"Crop rectangle does not fit within image data.",查看库里的代码发现:
public Rect getScanBoxAreaRect(int previewHeight) {
if (mIsOnlyDecodeScanBoxArea && getVisibility() == View.VISIBLE) {
Rect rect = new Rect(mFramingRect);
float ratio = 1.0f * previewHeight / getMeasuredHeight();
我的平板是1920x1200的分辨率,竖屏,摄像头为500w像素,通过Camera.Parameters.getSupportedPreviewSizes()获取支持的预览尺寸,发现最大为1280x768,远小于1920x1200,这样的话就会导致"Crop rectangle does not fit within image data.",查看库里的代码发现:
scanBoxAreaRect = mScanBoxView.getScanBoxAreaRect(height);
source = new PlanarYUVLuminanceSource(data, width, height, scanBoxAreaRect.left,
scanBoxAreaRect.top, scanBoxAreaRect.width(), scanBoxAreaRect.height(), false);
这样子会导致:
if (left + width > dataWidth || top + height > dataHeight) {
throw new IllegalArgumentException("Crop rectangle does not fit within image data.");
}
虽然能通过app:qrcv_isOnlyDecodeScanBoxArea="false"来解决,但是这样就会导致功能缺失,希望能解决一下,谢谢。
The text was updated successfully, but these errors were encountered: