canvas填充规则

canvas填充规则

const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

ctx.beginPath(); 
ctx.fillStyle='green'
ctx.arc(50, 50, 30, 0, Math.PI * 2, true);
ctx.arc(50, 50, 20, 0, Math.PI * 2, true);
ctx.arc(50, 50, 15, 0, Math.PI * 2, true);
ctx.arc(50, 50, 10, 0, Math.PI * 2, true);
ctx.fill('evenodd');

相关文章:

  • 2021-11-04
  • 2022-12-23
  • 2021-12-12
  • 2021-08-09
  • 2021-07-29
  • 2022-02-17
  • 2022-12-23
  • 2021-04-07
猜你喜欢
  • 2021-10-26
  • 2022-12-23
  • 2021-11-06
  • 2022-02-23
  • 2021-08-02
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案