Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In addition to loading images from files and from the Web, Cocoa Touch allows you to create new images on the fly. This blends UIKit functions with standard Quartz 2D graphics to build new UIImage instances.
So why would you build new images from scratch? The answers are many. You might create a thumbnail by shrinking a full-size picture into a new image. You could programmatically lay out a labeled game piece. You might generate a semitransparent backsplash for custom alert views. You can also add effects to existing images, such as the reflection discussed in Chapter 6, “Assembling Views and Animations,” or you might just want to customize an image in some other way. Each of these examples builds a new image in code, whether that image is based on another or built entirely from new elements.