Book Image

Canvas Cookbook

Book Image

Canvas Cookbook

Overview of this book

With the growing popularity of HTML5 Canvas, this book offers tailored recipes to help you develop portable applications, presentations, and games. The recipes are simple yet creative and build on each other. At every step, the book inspires the reader to develop his/her own recipe. From basic to advanced, every aspect of Canvas API has been covered to guide readers to develop their own application, presentation, or game.
Table of Contents (16 chapters)
Canvas Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Introduction


This chapter focuses on yet another very exciting topic of the HTML5 Canvas, images and videos. Along with providing basic functionality for positioning, sizing, and cropping images and videos, the HTML5 Canvas API also allows us to access and modify the color and transparency of each pixel for both mediums. Let's get started!

Host all the recipes on a web server (I used IIS) as a few recipes will not work on the local file://protocol. For security reasons, methods such as getImageData() require a web server to function.