18.11.2017 Views

html5_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

HTML5<br />

Drawing Quadratic<br />

Using Images<br />

Create Gradients<br />

Styles and Colors<br />

Text and Fonts<br />

Pattern and Shadow<br />

Canvas States<br />

Canvas Translation<br />

Canvas Rotation<br />

Canvas Scaling<br />

Canvas Transform<br />

Canvas Composition<br />

Canvas Animation<br />

Learn how to draw quadratic curve using HTML5 <br />

element<br />

Learn how to use images with HTML5 element<br />

Learn how to create gradients using HTML5 <br />

element<br />

Learn how to apply styles and colors using HTML5<br />

element<br />

Learn how to draw amazing text using different fonts and<br />

their size.<br />

Learn how to draw different patterns and drop shadows.<br />

Learn how to save and restore canvas states while doing<br />

complex drawings on a canvas.<br />

This method is used to move the canvas and its origin to a<br />

different point in the grid.<br />

This method is used to rotate the canvas around the current<br />

origin.<br />

This method is used to increase or decrease the units in a<br />

canvas grid.<br />

These methods allow modifications directly to the<br />

transformation matrix.<br />

This method is used to mask off certain areas or clear<br />

sections from the canvas.<br />

Learn how to create basic animation using HTML5 canvas<br />

and JavaScript.<br />

HTML5 Canvas - Drawing Rectangles<br />

There are three methods that draw rectangles on the canvas −<br />

Sr.No.<br />

1<br />

2<br />

3<br />

Method and Description<br />

fillRect(x,y,width,height)<br />

This method draws a filled rectangle.<br />

strokeRect(x,y,width,height)<br />

This method draws a rectangular outline.<br />

clearRect(x,y,width,height)<br />

This method clears the specified area and makes it fully transparent<br />

67

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

Saved successfully!

Ooh no, something went wrong!