Hour 10. Drawing with the HTML5 Canvas Element

What You’ll Learn in This Hour:

• How to use the <canvas> element to draw on web pages

• How to create lines, rectangles, and circles on canvases

• How to use images as portions of the canvas or as patterns

• What mobile devices support <canvas>

• How canvas differs from Flash and SVG

The HTML5 <canvas> element lets you use JavaScript to draw shapes, add images, and create animations right in your web page. It is not done with a different language (such as SVG) nor does it use a plug-in (like Flash).

In this hour you will learn what the <canvas> element is and how you can use it to create shapes and add images and text right inside the web browser. This hour serves as a jumping-off point for how ...

Get Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.