4 ms·
I get the feeling I'm missing something, but... var ctx = document.getElementById('canvas').getContext('2d'); var img = new Image(); img.onload = f
by grayrest 16y ago
I get the feeling I'm missing something, but...
var ctx = document.getElementById('canvas').getContext('2d');
var img = new Image();
img.onload = function(){ ctx.drawImage(img,0,0); }
img.src = 'path/to/the/nodejs/generated/image.png';