【发布时间】:2017-02-22 06:32:06
【问题描述】:
我可以获取带有二维条码图像的字符串消息,并使用输入字符串生成二维条码图像,但是如何获取带有一维条码的字符串消息以及如何生成带有字符串的字符串消息?下面的代码是关于二维条码的:
+ (NSString *)decodeImage:(CIImage *)ciImage {
NSDictionary *options = @{CIDetectorAccuracy : CIDetectorAccuracyHigh};
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:options];
NSArray *features = [detector featuresInImage:ciImage];
for (CIFeature *feature in features) {
if ([feature isKindOfClass:[CIQRCodeFeature class]]) {
CIQRCodeFeature *qrFeature = (CIQRCodeFeature *)feature;
return qrFeature.messageString;
}
}
return nil;
}
....
一维条码呢?
【问题讨论】: