Slicing up a UIImage on iPhone
问题 Objective: take a UIImage, crop out a square in the middle, change size of square to 320x320 pixels, slice up the image into 16 80x80 images, save the 16 images in an array. Here's my code: CGImageRef originalImage, resizedImage, finalImage, tmp; float imgWidth, imgHeight, diff; UIImage *squareImage, *playImage; NSMutableArray *tileImgArray; int r, c; originalImage = [image CGImage]; imgWidth = image.size.width; imgHeight = image.size.height; diff = fabs(imgWidth - imgHeight); if(imgWidth >