カテゴリー:
fill()メソッド
閲覧数:427 配信日:2016-01-29 09:37
1.パスに円弧を追加するarc()メソッドでの適用例
x座標値,Y座標値
・canvas中心
円弧の半径
・canvas÷2
コード
<canvas id="canv" width="500px" height="500px"></canvas>
<script>
var ctx1 = document.getElementById("canv").getContext('2d');
ctx1.fillStyle = "#0000CD";
ctx1.beginPath();
ctx1.arc(250, 250, 250, 15 * Math.PI / 180 , 270 * Math.PI / 180 , false);
ctx1.fill();
</script>