Drawing geometric figures

The WebKit engine provides an interesting element which allows drawing. Its name is canvas and it was originally designed for Apple to build Mac OS X dashboard applications. Sometime ago, the Cupertino company decided to extend its support to Safari and Safari Mobile web browsers. Regardless, canvas is fully supported under the recent HTML5 standard. This means that other web browsers such as Firefox or Opera can render a canvas component.

Basically, canvas defines an area inside the screen where we can draw geometric figures or simply display images. One of the most important benefits of the canvas element is that we don't require additional libraries or frameworks; all we need is a modern web browser Traditionally, ...

Get iPhone JavaScript Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.