1.线型粗细
ctx.lineWidth=10
2.边框风格,颜色
ctx.strokeStyle = 'rgba(0,0, 255, 0.5)'
3.绘制矩形边框
ctx.strokeRect(10,10,200,100)
4.填充风格
ctx.fillStyle = '#ff0000'
5.填充矩形
ctx.fillRect(10,10,200, 100)
ctx.clearRect(0,0, 400, 300)
← canvas-步骤 canvas-路径与画圆→