Create QR code in iphone

家住魔仙堡 提交于 2019-12-19 11:38:06

问题


I have seen some example codes, these code are creating QR codes froms Text (below is the code).can we generate QR codes from other data also (like Image)?

 NSString *code = @"1001012023034";

Barcode *barcode = [[Barcode alloc] init];

self.view.backgroundColor = [UIColor whiteColor];

[barcode setupQRCode:code];
self.imageView.image = barcode.qRBarcode;

My question is if we use Image instead of string data then is it possible?


回答1:


QR codes are pretty limited in terms of data storage, limited to a few kb - see http://en.wikipedia.org/wiki/QR_code#Storage for storage sizes. As such, you won't be able to put an image in there. What you CAN do, however, is upload the image somewhere and encode a link to that image instead.




回答2:


Yes, It's Possible. There are two Best Libraries available :

1) For Encoding : QR-Code-Encoder-for-Objective-C

2) For Decoding : ZBar bar code reader

GoodLuck.



来源:https://stackoverflow.com/questions/16054305/create-qr-code-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!