复制代码
代码如下:var canvas=document.getelementbyid('mycanvas');
var ctx= canvas.getcontext('2d');
ctx.fillstyle="#99ff66";
ctx.fillrect(10,10,15,80);
//ctx.fillrect(10,80,15,80);
var canvas=document.getelementbyid('mycanvas');
var ctx= canvas.getcontext('2d');
ctx.fillstyle="#99ff66";
ctx.fillrect(60,10,15,80);
var canvas=document.getelementbyid('mycanvas');
var ctx= canvas.getcontext('2d');
ctx.fillstyle="#0033cc";
ctx.fillrect(26,27,33,50);
ctx.fillstyle="red";
ctx.beginpath();
ctx.arc(43,52,17,0,math.pi*2,true);
ctx.closepath();
ctx.fill();
ctx.stroketyle="#cccc00";
ctx.linewidth=2;
ctx.moveto(43,52);
ctx.lineto(43,10);
ctx.stroke();