How to draw an ellipse with lineTo/arc/bezierCurveTo by html5
This article mainly introduces html5 how to use lineTo/arc/bezierCurveTo to draw an oval, the article is very detailed, has a certain reference value, interested friends must read it!
1. Use lineTo to draw an ellipse
You read it correctly, lineTo, which is purely used to draw straight lines, can be used to draw ellipses. But he does exist, but the way it is written is a little incredible:
The code is as follows:
Function DrawEllipse (Canvas,O,OA,OB) {
/ / draw an ellipse, for example: var B=new Array (150150); DrawEllipse (hb,B,50,30)
With (Canvas) {
Var Xeroo [0] + OA
Var Yellowo [1]
MoveTo (XBI y)
For (var iTuno Bandi)