20.11.2017 Views

My HTML 5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>HTML</strong>5<br />

}<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

The above example would draw the following shape:<br />

<strong>HTML</strong>5 Canvas - Drawing Quadratic Curves<br />

We require the following methods to draw quadratic curves on the canvas −<br />

Sr.No.<br />

1<br />

2<br />

3<br />

4<br />

5<br />

beginPath()<br />

This method resets the current path.<br />

moveTo(x, y)<br />

Method and Description<br />

This method creates a new subpath with the given point.<br />

closePath()<br />

This method marks the current subpath as closed, and starts a new subpath<br />

with a point the same as the start and end of the newly closed subpath.<br />

fill()<br />

This method fills the subpaths with the current fill style.<br />

stroke()<br />

This method strokes the subpaths with the current stroke style.<br />

6 quadraticCurveTo(cpx, cpy, x, y)<br />

78

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!