在iphone中创建二维码 [英] Create QR code in iphone
问题描述
我见过一些示例代码,这些代码是从文本创建QR代码(下面是代码)。我们可以从其他数据生成QR代码(如图像)吗?
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;
我的问题是,如果我们使用Image而不是字符串数据那么可能吗?
My question is if we use Image instead of string data then is it possible?
推荐答案
QR码在数据存储方面非常有限,仅限于几kb - 参见 http://en.wikipedia.org/wiki/QR_code#Storage 了解存储大小。因此,您将无法在其中放置图像。但是,你可以做的是将图像上传到某处并编码指向该图像的链接。
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.
这篇关于在iphone中创建二维码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!