Are you asking how to create thumbnails from larger images or how to create a view controller that displays them beautifully?
Creating a view controller:
You can use the TTPhotoViewController from the Three20 project ( description ), which acts similar to the iPhone's built-in camera roll to view images.
You can see the code for the Scrolling sample from the apple, which is mentioned in this question about using it for sketches .
If you want to create it yourself, you can use the GridView from moriarty library , either as a large grid in UIScrollView , or as a more efficient line by line in UITableView . There was a previous question about optimized image loading in UIScrollView .
Thumbnailing large images:
The easiest way to scale an image is to simply display it in a UIImageView with the frame set to the smaller size you need - it scales for you.
If you want to save a thumbnail or care about memory usage, you can create a hard version. The sample code below is taken from this blog post and can be added to UIImage as a category method:
- (UIImage*) imageScaledToSize: (CGSize) newSize { UIGraphicsBeginImageContext(newSize); [self drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; }
Finally, here is the previous question about masking around corners in the image , similar to the application icons that are used on the main screen.
Added
Using the built-in image thumbnail:
There is a nice feature called CGImageSourceCreateThumbnailAtIndex that understands inline thumbnails in specific image data formats. You can see a useful code example for this in the โCreating Thumbnail Image from Image Sourceโ section of Apple's I / O Programming Guide .