1.路径绘图:

  1. 把“钢笔”移动到画布的某个位置上
    1. ctx.moveTo(x,y)
  2. 把“钢笔”连线到画布的某个位置上
    1. ctx.lineTo(x,y)
  3. 描边路径的api
    1. ctx.stroke()
  4. 填充路径的api
    1. ctx.fill()
  5. 描边路径的样式
    1. ctx.strokeStyle = 'red' 描边的颜色
    2. ctx.lineWidth = 5 线宽
  6. 填充的样式
    1. ctx.fillStyle = 'blue' 填充的颜色
  7. 路径的闭合
    1. ctx.closePath 把起点和终点链接到一起
  8. 另起一个新的路径
    1. ctx.beginPath

相关文章:

  • 2021-08-14
  • 2021-08-06
  • 2021-07-24
  • 2021-06-27
  • 2021-08-10
  • 2021-08-22
猜你喜欢
  • 2021-10-21
  • 2022-01-01
  • 2022-03-15
  • 2021-06-20
  • 2021-12-08
  • 2021-08-26
  • 2021-09-09
相关资源
相似解决方案