I've been using zxing to decode QRCodes. I've also now the got the encoder working and can create the QRCode which contains the encoded data.
I'm asking if anyone knows how to convert this QRCOde data to a png image.
I've been using zxing to decode QRCodes. I've also now the got the encoder working and can create the QRCode which contains the encoded data.
I'm asking if anyone knows how to convert this QRCOde data to a png image.
If you are using phonegap and needs offline support, perhaps jquery qrcode could help.
If your app has online access then you can use something like http://www.tag.cx/qr-codes/
Many users are looking for a way to encode QR codes and other codes programmatically on the iPhone. These features have not been ported from Android to iPhone yet as described in this Zxing thread: https://groups.google.com/group/zxing/browse_thread/thread/7325ed13cc49122c/aba6f4545c5c3583?lnk=gst&q=encode+to+png+iphone#aba6f4545c5c3583
Please see this question for further discussion: Generate 2D bar code (e.g. QR Code, Data Matrix, PDF417) on iPhone and Android
You can use Phonegap to encode a QR barcode using the plugin here. Follow the instructions and you should be successful.
The Javascript is simple, taken straight from https://github.com/phonegap/phonegap-plugins/
The psytec encoder (http://groups.google.com/group/zxing/msg/27e421daeb510d0f) works well. I use it in production. It should be relatively starightforward to use something like libpng to go from the bit array it produces to a png. On devices, I go through the bit array it produces and draw straight into CG contexts.
Download the sample code for QR-code Generator from this Github link, It is more simpler and easier. Add the resource files which were used in that sample project to your project.
If you want just to show the QR-code generated in a
UIImageview
, you can directly use the code in the sample projector
If you need the png file with the QR code means you can get the
NSData
from the image of theUIImageview
and convert theNSData
to png file and use it.Edited There are similar questions of this post, I linked to this answer.
I used this simple code to encode a QRCode in one of my projects. You can use:
Implementation .m