HTML and CSS Reference
In-Depth Information
Figure 7-7. Centering the stop icon along the x and y axes
Before you begin to draw new shapes in Canvas, it's a good idea to call
context.beginPath() . This will create a new path within the context for you to
start drawing. It's the equivalent of lifting your pen off of the page before you
draw a new shape on a piece of paper.
Next, you will need to set the fillStyle of the shape you are about to draw. The
2D context API has several methods for drawing. The API's most basic methods
and properties are shown in Tables 7-4 and 7-5.
Search WWH ::

Custom Search