Drawing paths on canvas HTML5

We can make a shape using paths including lines and arc. In this chapter we will learn how to draw path. So let’s start with these JavaScript methods:


To draw a every new path we need to call beginPath() method. Suppose in your canvas you need to draw various path then you need to call beginPath() method to draw each path.
closePath() method close the shape by drawing a straight line or arc from the current point to start. Wee’ll see the use of both method in below examples.
Now there two other methods:


stroke() method is used to draw am outlines shape and where fill() method is used to paint a shape.
You will see the how to draw a path in the form of lines and arcs in next articles.