今日学习
画布
DOM–>context
context.fillStyle = ‘’;
context.strokeStyle = ‘’;
context.lineWidth = ‘’;
context.fillRect(x,y,width,height);
context.strokeRect(x,y,width,height);
context.clearRect(x,y,width,height);
路径
context.beginPath();
context.moveTo(x,y);
context.lineTo(x,y);
绘制画布
context.fill();
context.stroke();
设置绘图样式
context.fillStyle = ‘blue’;
context.strokeStyle=‘blue’;
绘制填充矩形 参数分别代表起点xy坐标,宽高
context.fillRect(100,100,100,100);
绘制边框矩形
context.strokeRect(300,100,100,100);
清除区域
context.clearRect(140, 140, 20, 20);
2020-04-27
最新推荐文章于 2020-11-04 19:29:28 发布