Author: Oswald Campesato
Reviewer: David Conrad
There now seem to be too many ways to create graphics within a web page. As well as HTML5 Canvas and CSS3, this book also has quite a lot about SVG.
The book starts off with a look at CSS3 and puts HTML5 into context with some information about browsers and backward compatibility. From here it deals with some basic CSS graphics - shadows and gradient fills. The big problem is that the layout of the book looks messy and the listings are very poorly presented with lots of unnecessary white space and quite a lot of repeated boiler plate code. Given that the book has a companion DVD containing all the source code, you have to wonder why so much of the book is taken up with listings.
Chapter 4 is where the canvas object enters the picture. It starts with a basic look at the canvas object and then spends far too much time explaining how to draw rectangles and a big example of how to do it. After lots more example the chapter draws to a close with a look at how to get data out of canvas using the toDataURL method. Chapter 5 is a detailed look at gradient fills. Again there are far too many examples which while they look good don't really help you understand how to do things. The end of the chapter does cover a topic which is usually missed - using CSS with the canvas object to create hover over effects and animation.
In Chapter 6 we learn about circles, bezier curves and arcs. There are some nice examples but at the end of the day the chapter is light on explanation. For example, you will learn how to use the arcto method to create rounded rectangles but you wont understand how you did it or how the arcto method works. Chapter 7 applies transforms to 2D shapes and this really is just a selection of examples that might be better in a cookbook.
Chapter 8 explains mouse events on the canvas, Chapter 9 is on animation and Chapter 10 demonstrates how to draw charts and graphs. This part of the book is almost completely a set of long examples rather than explanation.
This is mostly a book of example code. The listings are long and they take up most of the space in the book. This seems a even more pointless when you discover that the programs are all on a DVD bound into the back of the book. However, if you want a book of examples then this one might be what you are looking for. The examples are sometimes trivial but just occasionally they suggest a way of doing something that you might not have thought of. If you are looking for a book that explains how things work, then you probably need a different book - this one has too much example code.