我的代码如下,两种黑色都会将内部圆的边框覆盖掉<script> var canvas = document.getElementById("myCanvas"); var ctx = canvas.getContext("2d"); var radius=10; for(var a=0;a<3;a++){ ctx.beginPath(); ctx.arc(100,100,radius,0,Math.PI*2); ctx.strokeStyle="red" ctx.stroke() ctx.fill() ctx.closePath(); radius+=20 } /*ctx.beginPath(); ctx.arc(100,100,10,0,Math.PI*2); ctx.strokeStyle="green" ctx.stroke() ctx.fill() ctx.closePath(); ctx.beginPath();![图片描述][1] ctx.arc(100,100,30,0,Math.PI*2); ctx.strokeStyle="green" ctx.stroke() ctx.fill() ctx.closePath(); */ </script>
添加回答
举报
0/150
提交
取消