diff nodejs/examples/simple/testimage.js @ 939:a74b4d986a91

Move examples for nodejs into nodejs/examples/ sub-directories. See INSTALL.txt. Use nodejs/examples/run.sh to run examples. For example, cd nodejs/examples; ./run.sh examples/testsvg/testsvg.js
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 12 Nov 2010 17:39:04 +0800
parents nodejs/testimage.js@fc035abcf82a
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nodejs/examples/simple/testimage.js	Fri Nov 12 17:39:04 2010 +0800
@@ -0,0 +1,19 @@
+// -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 4; -*-
+// vim: sw=4:ts=8:sts=4
+var svg = require("svg");
+var mbapp = require("mbapp");
+var sys=require("sys");
+var animate=require("animate");
+var fs = require("fs");
+
+app = new mbapp.app();
+
+coord = app.mb_rt.coord_new(app.mb_rt.root);
+data=mbapp.ldr.load("sample.png");
+paint = app.mb_rt.paint_image_new(data);
+img = app.mb_rt.image_new(10,10,50,50);
+paint.fill(img);
+coord.opacity = 0.9;
+coord.add_shape(img);
+
+app.loop();