SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 151 | Next

Richard Wagner

"Professional iPhone and iPod touch Programming: Building Applications for Mobile Safari"

The image can reference either an external image or another canvas element on
the page. There are actually three ways in which you can call this method. The first variant simply draws
an image at the specified coordinates using the size of the image:
context.drawImage(image, x, y)
The second method enables you to specify the dimensions of the image with the w and h arguments:
context.drawImage(image, x, y, width, height)
To do a basic image draw, define the Image object and assign an src . Next, you want to draw the image,
but only after you are certain the image is fully loaded. Therefore, the drawImage() method is placed
inside of the image??™s onload handler:
???http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd???>


Draw Image
user-scalable=0;???>