LBXScan
LBXScan copied to clipboard
扫码识别区设置问题
你好,项目若只引用LBXScan/LBXNative
扫码识别区如何设置? 我看到LBXScanNative.m中有setScanRect方法去设置,但是没有公开, 并且这个方法没有被其他方法调用? 这个设计是什么意思
/** @brief 初始化采集相机 @param preView 视频显示区域 @param objType 识别码类型:如果为nil,默认支持很多类型。(二维码如QR:AVMetadataObjectTypeQRCode,条码如:AVMetadataObjectTypeCode93Code @param cropRect 识别区域,值CGRectZero 全屏识别 @param block 识别结果 @return LBXScanNative的实例 */
- (instancetype)initWithPreView:(UIView*)preView ObjectType:(NSArray*)objType cropRect:(CGRect)cropRect success:(void(^)(NSArray<LBXScanResult*> *array))block;
有初始化方法的
我看了源码,但是这个初始化方法内部没有自动转换为rectOfInterest,需要自己转换为preview的识别区域,自己转换相当麻烦
LBXScanNative *native = [[LBXScanNative alloc]initWithPreView:self.view ObjectType:nil cropRect:CGRectZero success:^(NSArray<LBXScanResult *> *array) {
NSLog(@"array = %@",array);
}];
[native setNeedCaptureImage:YES];
[native startScan];
我用这个扫不出来东西,我怀疑我的打开方式不对了。。。