Canvas Examples -Using Paths

The beginPath the function starts a new path, and moveTolineToarcToarc, and similar methods are used to add segments to the path. The path can be closed using closePath. Once a path is created, you can use fill or stroke to render the path to the canvas.

Calling fill() or stroke() causes the current path to be used. To be filled or stroked again, the path must be recreated.