HTML5中关于Canvas的Javascript使用
var cav = document.getElementById("canvas");
cav.width = 600;
cav.height = 600;
var cxt = cav.getContent("2d");
cxt.moveTo(10,10);
cxt.lineTo(150,50);
cxt.linetTo(10,50);
cxt.strokeyStyle="red";
cxt.stroke();
cxt.fillStyle="red";
cxt.fillRect(100,100,200,40);
cxt.beginPath();
cxt.moveTo(60,60);
cxt.arc(60,60,50,0,60*Math.PI/180);
cxt.fill();
cxt.beginPath();
cxt.arc(160,160,50,0,60*Math.PI/180);
cxt.closePath();
cxt.stroke();
cxt.arc(200,200,50,0,60*Math.PI/180);
cxt.stroke();
cxt.beginPath();
cxt.arc(60,60,50,0,360);
cxt.fillStyle="red";
cxt.fill();
cxt.strokeStyle="blue";
cxt.lineWidth=5;
cxt.stroke();
cxt.closePath();
cxt.fillText("Hello World", 70,320);