moveTo(378,560);
lineTo(368,560);
quadraticCurveTo(358,570,368,585);
quadraticCurveTo(388,580,405,585);
quadraticCurveTo(422,561,400,570);
rect(368,585,10,4)
stroke();
fill();
//ctx.rotate( m * Math.PI / 180)
closePath();
//白点
beginPath();
strokeStyle="#f5e262";
fillStyle="#c4b127";
fill();
EvenCompEllipse(ctx, 160, 100, 10, 15);
EvenCompEllipse(ctx, 150, 150, 5, 7);
EvenCompEllipse(ctx, 200, 320, 7, 10)
EvenCompEllipse(ctx, 225, 350, 11, 16)
EvenCompEllipse(ctx, 425, 120, 11, 16)
EvenCompEllipse(ctx, 410, 320, 9, 12)
EvenCompEllipse(ctx, 380, 340, 6, 9)
closePath();
}
function EvenCompEllipse(ctx, x, y, a, b)
{
ctx.save();
//选择a、b中的较大者作为arc方法的半径参数
var r = (a > b) ? a : b;
var ratioX = a / r; //横轴缩放比率
var ratioY = b / r; //纵轴缩放比率
ctx.scale(ratioX, ratioY); //进行缩放(均匀压缩)
ctx.beginPath();
//从椭圆的左端点开始逆时针绘制
ctx.moveTo((x + a) / ratioX, y / ratioY);
ctx.arc(x / ratioX, y / ratioY, r, 0, 2 * Math.PI);
ctx.closePath();
ctx.stroke();
ctx.fill();
ctx.restore();
};
</script>
</html>









