arc路径例子-磊哥
   <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>使用路径</title>
</head>
<body>
    <canvas );

    ctx.strokeStyle = "#163B62";
    ctx.beginPath();
    ctx.arc(70, 70, 40, Math.PI*0.3, Math.PI * 0.8, false);
    ctx.stroke();

    ctx.strokeStyle = "#000000";
    ctx.beginPath();
    ctx.arc(160, 70, 40, Math.PI * 0.55, Math.PI * 0.7, false);
    ctx.stroke();

    ctx.strokeStyle = "#000000";
    ctx.beginPath();
    ctx.arc(160, 70, 40, -Math.PI * 0.1, Math.PI * 0.1, false);
    ctx.stroke();
       
    ctx.strokeStyle = "#BF0628";
    ctx.beginPath();
    ctx.arc(250, 70, 40, Math.PI * 0.55, Math.PI * 0.7, false);
    ctx.stroke();
 

 

</script>
</body>
</html>

相关文章: