LBXScan icon indicating copy to clipboard operation
LBXScan copied to clipboard

扫码识别区设置问题

Open sunzhongliangde opened this issue 6 years ago • 4 comments

你好,项目若只引用LBXScan/LBXNative

扫码识别区如何设置? 我看到LBXScanNative.m中有setScanRect方法去设置,但是没有公开, 并且这个方法没有被其他方法调用? 这个设计是什么意思

sunzhongliangde avatar Oct 11 '18 08:10 sunzhongliangde

/** @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;

MxABC avatar Oct 11 '18 08:10 MxABC

有初始化方法的

MxABC avatar Oct 11 '18 08:10 MxABC

我看了源码,但是这个初始化方法内部没有自动转换为rectOfInterest,需要自己转换为preview的识别区域,自己转换相当麻烦

sunzhongliangde avatar Oct 11 '18 09:10 sunzhongliangde

LBXScanNative *native = [[LBXScanNative alloc]initWithPreView:self.view ObjectType:nil cropRect:CGRectZero success:^(NSArray<LBXScanResult *> *array) {
    NSLog(@"array = %@",array);
}];
[native setNeedCaptureImage:YES];
[native startScan];

我用这个扫不出来东西,我怀疑我的打开方式不对了。。。

zcw46229412 avatar Nov 07 '18 09:11 zcw46229412