arc路径例子-磊哥

arc路径例子-磊哥
   <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>使用路径</title>
</head>
<body>
    <canvas id="ourCanvas" width="500" height="500" style="border:3px dashed #0094ff;"></canvas>
<script>
    var canvas = document.getElementById("ourCanvas");
    var ctx = canvas.getContext("2d");

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>

上一篇:asp.net后台正则表达式验证手机号码邮箱


下一篇:.NET6 微服务——CI/CD(1):搭建Jenkins并实现自动构建