Skip to content

Instantly share code, notes, and snippets.

@nulltask
Created February 5, 2012 09:02
Show Gist options
  • Save nulltask/1744249 to your computer and use it in GitHub Desktop.
Save nulltask/1744249 to your computer and use it in GitHub Desktop.
qCanver sample
var Canvas = require('canvas')
, q = require('qcanver')
, fs = require('fs')
, canvas = new Canvas(1000, 1000)
, out = fs.createWriteStream(__dirname + '/output.png');
q(canvas)
.begin(50, 10)
.line(10, 75)
.line(90, 75)
.draw("fill");
var stream = canvas.createPNGStream();
stream.on('data', function(chunk){
out.write(chunk);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment