// sample.js var Canvas = require('canvas') , http = require('http'); http.createServer(function (req, res) { var canvas = new Canvas(200,200); var ctx = canvas.getContext('2d'); // 四角形描画 ctx.fillStyle = 'rgba(0, 0, 255, 0.5)'; ctx.fillRect(10, 10, 190, 190); // テキスト描画 var text = "Canvas Test"; ctx.font = '30px Impact'; ctx.rotate(.1); ctx.fillStyle = 'rgba(0, 0, 0, 1.0)'; ctx.fillText(text, 10, 1