EDIT: As with other answers, as well as links to an explanation of PNG javascript there. Hooray!
If you want to create a PNG image file, your question basically asks the question: βWhat is the file format for PNG? And how to convert the QR code grid to an image that is a QR code image, given that I can define this QR code using a sequence of 1s and 0s. "
You will need to consider LZW compression if you want to use PNG. Why not look at uncompressed GIFs or bitmaps? Use Titanium to create the file, hard code for the header for your image format, and then use the appropriate encoding to programmatically create your image.
But if you just want to display the QR code on the screen, why not use the Titanium Webview canvas? Or, if you are worried that it is too slow (it is not intended for draft boxes), use titanium + plus Paint for iOS.
A 'hack' may be to use absolute positioning user interface elements to create your QR code image by drawing it with user interface elements. Cool hack.
Or you can just use the SVG format in web browsing. Personally, I believe that the easiest if you need a file is to use a bitmap with a hard-coded header, as I said above, or GIF if you cannot use a bitmap.
If you just need an image, I will try to use one of the Appcelerator drawing methods.
Good luck
Crisp stringfellow
source share