如何使用zxing库获取扫描的条形码类型? [英] How to obtain scanned barcode type with zxing library?

查看:101
本文介绍了如何使用zxing库获取扫描的条形码类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何通过zxing库获取条形码类型?委托方法仅返回文本中的条形码.

How i can obtain bar code type with zxing library? Delegate method return only barcode in text.

推荐答案

委托回叫是

- (void)decoder:(Decoder *)decoder didDecodeImage:(UIImage *)image usingSubset:(UIImage *)subset withResult:(TwoDDecoderResult *)twoDResult {

Decoder.mm中的readers属性是FormatReaders的列表.

The readers property in Decoder.mm is a list of FormatReaders.

@interface FormatReader : NSObject {
      zxing::Reader *reader_;
}

FormatReader中的reader_变量将是zxing :: Reader的C ++子类,如QRCodeReader.检查该类名将有助于确定您要获得的符号系统.当心其中一些是结合其他阅读器的"MultiFormat"阅读器,因此您可能需要进行一些巧妙的检查.

The reader_ variable in FormatReader will be a C++ subclass of zxing::Reader, like QRCodeReader. Checking this class name will help identify what symbology you're getting. Beware some of them are 'MultiFormat' readers that combine other readers, so you might have to do some clever inspection.

有关如何在C ++中获取类名的信息,请参见如何获取类名?

See How to get class name? for how to get class name in C++.

如果最终做出了有益的修改,请确保将补丁提交回zxing.祝你好运!

If you end up making helpful modifications, make sure to submit a patch back to zxing. Good luck!

这篇关于如何使用zxing库获取扫描的条形码类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆