canvas

canvas(画布)

使用方法:

先用js获得节点

通过getConttext(2d)声明方法,在进行绘画

样式:

 

fill  填充

fillStyle ="颜色";

fillRect(x,y,w,h); 

 

stroke 不填充线条

strokeStyle = “颜色”;

strokeRect(x,y,w,h); 

 

arc 绘制圆

arc(x,y,r,0,2*Math.PI);x,y圆心坐标,r半径,0弧度;

 

绘制线条

moveTo();起始点

lineTo();结束点

 

posted @ 2017-06-29 11:28  幸为天下客  阅读(71)  评论(0编辑  收藏  举报