iphone开发 二维码和条形码的识别
2013-11-28 06:45
344 查看
具体操作步骤:
download ZBar SDK from here
add below frameworks in your project
AVFoundation.framework
CoreGraphics.framework
CoreMedia.framework
CoreAudio.framework
CoreVideo.framework
QuartzCore.framework
libiconv.dylib
Add the library downloaded libzbar.a of zip in the frameworks
import header in your class and confirm it's delegate
#import "ZBarSDK.h"
and
5.scan image
6.get the result in
参考用例:How
to use Barcode Scanner (BR and QR) in iPhone Tutorial (using ZBar)
download ZBar SDK from here
add below frameworks in your project
AVFoundation.framework
CoreGraphics.framework
CoreMedia.framework
CoreAudio.framework
CoreVideo.framework
QuartzCore.framework
libiconv.dylib
Add the library downloaded libzbar.a of zip in the frameworks
import header in your class and confirm it's delegate
#import "ZBarSDK.h"
and
@interface ViewController : UIViewController <ZBarReaderDelegate>
5.scan image
- (IBAction)startScanning:(id)sen 4000 der { NSLog(@"Scanning.."); resultTextView.text = @"Scanning.."; ZBarReaderViewController *codeReader = [ZBarReaderViewController new]; codeReader.readerDelegate=self; codeReader.supportedOrientationsMask = ZBarOrientationMaskAll; ZBarImageScanner *scanner = codeReader.scanner; [scanner setSymbology: ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0]; [self presentViewController:codeReader animated:YES completion:nil]; }
6.get the result in
- (void) imagePickerController: (UIImagePickerController*) reader didFinishPickingMediaWithInfo: (NSDictionary*) info { // get the decode results id<NSFastEnumeration> results = [info objectForKey: ZBarReaderControllerResults]; ZBarSymbol *symbol = nil; for(symbol in results) // just grab the first barcode break; // showing the result on textview resultTextView.text = symbol.data; resultImageView.image = [info objectForKey: UIImagePickerControllerOriginalImage]; // dismiss the controller [reader dismissViewControllerAnimated:YES completion:nil]; }
参考用例:How
to use Barcode Scanner (BR and QR) in iPhone Tutorial (using ZBar)
相关文章推荐
- android开发游记:二维码和条形码的识别和生成
- Android开发之二维码生成与识别
- 实例源码--ZXing识别条形码和二维码识别源码
- iOS开发——iOS7(及以后版本) SDK自带二维码(含条形码)扫码、二维码生成
- iOS开发中使用CIFilter生成二维码和条形码
- 关于Zbar和ZXing这两个无比强大的二维码和条形码识别工具
- 扫描二维码、扫描条形码、相册获取图片后识别、生成带 Logo 二维码、支持微博微信 QQ 二维码扫描样式
- 在Android上使用ZXing识别条形码/二维码
- [IPHONE] iOS使用ZbarSDK实现扫描二维码以及条形码功能
- Swift开发小技巧--识别选中照片中的二维码
- 关于Zbar和ZXing这两个无比强大的二维码和条形码识别工具
- Android二维码、条形码开发包(有源码)
- iphone开发 用户点击,触摸和手势识别 解析
- Android上使用ZXing识别条形码与二维码的方法
- .NET C#利用ZXing生成、识别二维码/条形码
- 微信开发,解决jquery.qrcode.min.js生成二维码长按不识别问题
- 条形码,二维码 精确识别
- iOS 自定义二维码条形码扫描识别
- 关于Zbar和ZXing这两个无比强大的二维码和条形码识别工具
- swift之生成条形码、二维码、识别二维码、长按识别二维码