Skip to content

Instantly share code, notes, and snippets.

@KennyTw
KennyTw / nodecanvas.js
Last active December 12, 2015 10:47
node canvas load image addtext
var img = new Canvas.Image; // Create a new Image
img.src = data;
var canvas = new Canvas(img.width, img.height);
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, img.width, img.height);
ctx.font = '22px Helvetica';
ctx.fillText('Hello World', img.width/2, img.height/3);
var stream = canvas.createPNGStream();*/