Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的相机屏幕上显示一个方框,我想捕捉那个方框内的区域,我该如何实现?它不会扫描任何条形码或 QR 码,它只会捕获方框内的区域并跳过所有其余部分。
这是视图的图像
你不能直接实现。按照以下步骤操作:
快照:this.camera.takePictureAsync({ fixOrientation: true, mirrorImage: true })
通过将cropData 设置为使用ImageEditor 进行裁剪
常量 { uri, 宽度, 高度 } = captureImg;
{偏移量:{x:0,y:0},尺寸:{图像宽度,高度},显示尺寸:{宽度:cameraSize.width,高度:cameraSize.height}}
现在用盒子原点和大小裁剪你的相机大小的照片