<!DOCTYPE html5>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS3-Canvas画布(图形-圆)</title>
<script>
window.οnlοad=function () {
var canvas=document.getElementById("canvas");//获取canvas对象
var ctx=canvas.getContext("2d"); //创建二维的绘图上下文对象
ctx.beginPath();
ctx.arc(100,75,50,0,2*Math.PI);
//参数分别是(横坐标、纵坐标、半径、起始角(弧度计0.5PI/1PI/1.5PI/2PI)、结束角 、可选(False顺时针,true逆时针))
ctx.stroke();
}
</script>
</head>
<body>
<h2>Canvas画布(图形-圆)</h2>
<canvas id="canvas" width="500" height="500" style="border:1px solid red ">
浏览器不支持canvas
</canvas>
</body>
</html>
转载于:https://www.cnblogs.com/YoogaChan/p/6964728.html