Merge pull request #6 from ironwolf/master

High Res QR Codes
This commit is contained in:
pointbiz 2012-10-20 10:18:50 -07:00
commit 24540cf673

View file

@ -4370,9 +4370,13 @@
var height = qrcode.getModuleCount() * sizeMultiplier; var height = qrcode.getModuleCount() * sizeMultiplier;
// create canvas element // create canvas element
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
canvas.width = width; var scale = 10.0;
canvas.height = height; canvas.width = width * scale;
canvas.height = height * scale;
canvas.style.width = width + 'px';
canvas.style.height = height + 'px';
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
ctx.scale(scale, scale);
// compute tileW/tileH based on width/height // compute tileW/tileH based on width/height
var tileW = width / qrcode.getModuleCount(); var tileW = width / qrcode.getModuleCount();
var tileH = height / qrcode.getModuleCount(); var tileH = height / qrcode.getModuleCount();