Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

7. Deeper into the Canvas > Other Things You Can Draw on the Canvas

Other Things You Can Draw on the Canvas

Using the canvas, you can painstakingly recreate any drawing you want, from a bunch of lines and triangles to a carefully shaded portrait. But as the complexity of your drawing increases, so does the code. It’s extremely unlikely that you’d write by hand all the code you need to create a finely detailed picture.

Fortunately, you have other options. The drawing context isn’t limited to lines and curves—it also has methods that let you slap down pre-existing images, text, patterns, and even video frames. In the following sections, you’ll learn how to use these methods to get more content on your canvas.

Drawing Images

You’ve probably seen web pages that build maps out of satellite images, which they download and stitch together. That’s an example of how you can take images you already have and combine them to get the final image that you want.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint