I\'m subclassing UIImageView to create a tile-based application. Essentially, I am taking a single image file and breaking it up into pieces, and then assignin
UIImageView
Here we go:
UIImage* img = [UIImage imageNamed:@"myImage.jpg"]; CGRect imgFrame = CGRectMake(x, y, tileWidth, tileHeight); CGImageRef imageRef = CGImageCreateWithImageInRect([img CGImage], imgFrame); UIImage* subImage = [UIImage imageWithCGImage: imageRef]; CGImageRelease(imageRef);