O'Reilly logo

Core HTML5 Canvas: Graphics, Animation, and Game Development by David Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Images and Video

HTML5 Canvas provides extensive support for images. You can draw all or part of an image, scaled or unscaled, anywhere inside a canvas, and you can access and manipulate the color and transparency of each pixel. And by combining image manipulation with other aspects of the Canvas API such as clipping regions and offscreen canvases, you can create stunning effects, such as animations and multiplayer games, data visualization, or particle physics simulations.

Figure 4.1 shows a magnifying glass that demonstrates some of what’s possible with Canvas image manipulation. As you drag the magnifying glass, the application scales the pixels underneath the magnifying glass, and draws them back into the canvas, clipped to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required