这个是我用canvas 画出来的 下面是代码片段 https://developers.weixin.qq.com/s/UI8SbKmj7wmS
var ctx = canvas.getContext('2d')
var centerX = width / 2;
var centerY = height / 2;
var rad = Math.PI * 2 / 100; //Math.PI = 180°,此处是吧360°分成100份
var speed = 30;
console.log(width, height)
function dot() {
ctx.beginPath()
ctx.arc(68, 68, 30, 0, 2 * Math.PI)
ctx.strokeStyle ='blue'
ctx.fill()
}
dot()
https://developers.weixin.qq.com/s/i1PJeKmT7Fmc
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人
<canvas style="width: 68px; height: 68px;" type="2d" id="canvas"></canvas>
我也是画出了椭圆,难道canvas的宽高比一定要2:1才能展示正常?