【canvas】半圆和半弧——首尾是否绘制连接


<body>
<canvas id="c1" style="border:1px solid red;display:block;margin:0 auto;"></canvas>
</body>
<script>
window.onload=function(){
var canvas=document.getElementById('c1');
var context=canvas.getContext('2d');

canvas.width='800'
canvas.height='800'

context.beginPath();
context.arc(400,400,200,0,0.5*Math.PI,true);
context.closePath();
context.strokeStyle='blue';
context.stroke();
}
</script>
</html>

 

<body>
<canvas id="c1" style="border:1px solid red;display:block;margin:0 auto;"></canvas>
</body>
<script>
window.onload=function(){
var canvas=document.getElementById('c1');
var context=canvas.getContext('2d');

canvas.width='800'
canvas.height='800'

context.beginPath();
context.arc(400,400,200,0,0.5*Math.PI,true);
context.strokeStyle='blue';
context.stroke();
context.closePath();
}
</script>
</html>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM