

function position (x,y){
this.x = x;
this.y = y;
}
var canvas = document.getElementById('canvas'),
ctx = canvas.getContext('2d');
width = canvas.width,
height = canvas.height;
ctx.fillStyle = "#FF0000";
ctx.font = "20px Arial";
ctx.fillText("妈妈",10,50);
var pixs = ctx.getImageData(0,0,width,height).data;
var Pixels = new Array();
for(var i=0;i if(r != 0 || g != 0 || b != 0 ){ script>
var r = pixs[i],
g = pixs[i+1],
b = pixs[i+2],
a = pixs[i+3];
var x = i%400;
var y = i/400;
Pixels.push(new position(x,y));
}
}
