canvas (画布)
1、默认尺寸300*150
2、getcontext(“2d”)获取笔
--->var ctx = myEle.getContext("2d");
3、rect(x, y, 宽, 高,)
--->ctx.rect(250, 200, 300,300);
ctx.shadowBlur=100;
ctx.shadowColor="greenyellow";
ctx.fillStyle="red";
ctx.fill();
4、fill 填充
--->ctx.rect(250, 200, 300,300);
ctx.shadowBlur=100;
ctx.shadowColor="greenyellow";
ctx.fillStyle="red";
ctx.fill();
5、stoke 画边
--->ctx.strokeStyle="yellow";
ctx.stroke();
6、
--->每次画都要用beginpath清空
--->closepath回到起点
7、save和restore
--->save 保存当前状态
--->restore 回到上一个save状态
canvas (画布)
免责声明:文章转载自《canvas (画布)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=