在我的应用程序中,Zbar 解码完美。但问题是 Zbar 可以解码 QR 码和条形码。那么解码后,如何获取Encoding Style的类型呢?
最佳答案
ZBarSymbol 中有类型的返回码。您将为 QR 码寻找 ZBAR_QRCODE
像这样的东西应该可以帮助你得到符号:
- (void) readerView: (ZBarReaderView*) view didReadSymbols: (ZBarSymbolSet*) syms fromImage: (UIImage*) img
{
//do something useful with results and display resultText in resultViewController
for(ZBarSymbol *sym in syms)
{
imageResult3.image = img;
resultText.text = sym.typeName;
resultText.text = [ resultText.text stringByAppendingString:@" - " ];
resultText.text = [ resultText.text stringByAppendingString:sym.data ];
}
}
关于iphone - 如何从zbar获取条码类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18587917/