Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Thumbnails play an important role in any application that uses images. Often you need to resize an image to fit into a smaller space. Sure, you can load up a UIImageView with the full-sized original and resize its frame, but you can save a lot of memory by redrawing that image into fewer bytes. Thumbnails can use one of three approaches, as demonstrated in Figure 7-9:
• Resize the image while retaining its proportions, fitting it so every part of the image remains visible. Depending on the image’s aspect ratio, you’ll need to either letterbox or pillarbox some extra area, matting the image with transparent pixels.
• Punch out part of the image to match the available space. The example in Figure 7-9 chooses a centered subimage and crops any elements that fall outside the pixel area.