HTML and CSS Reference
In-Depth Information
Figure 7-7. The rectangle drawn by strokeRect(30,30,200,100) in a 300 by 300 pixel
canvas
Drawing more complex shapes than a rectangle is more complicated. A line needs
to be created—also known as a path —which can be used to build the shape segment
by segment. The following are the relevant methods for drawing a simple shape with
straight edges:
beginPath() : Starts a new line
closePath() : Finishes a new line
moveTo(x,y) : Moves to a coordinate on the canvas
 
Search WWH ::




Custom Search