<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title></title>
</head>
<style type="text/css">
body{
margin:0px;
background:#000;
}
#canvas{
display:block;
background:#fff;
width:500px;
height:500px;
margin:50px auto;
}
</style>
<body>
<canvas id="canvas">asdf</canvas>
</body>
<script>
var cxt = canvas.getContext("2d");
cxt.save();//保存路径
cxt.beginPath();//开始路径
cxt.arc(250,250,100,0,Math.PI*2,false);
cxt.closePath();//结束路径
cxt.fill();//填充方法
cxt.restore();//释放路径
// https://blog.csdn.net/cat_foursi/article/details/71543775
</script>
</html>
realwds
相关分类