我目前正在寻找一种方法来将图像(例如从照片库中抓取的图像)切割成许多不同的矩形块。任何人都可以指出我正确的方向吗?
答案 0 :(得分:5)
CGImageRef topLeftImageRef = CGImageCreateWithImageInRect(originalImage.CGImage, CGRectMake(0,0,originalImage.size.width/2,originalImage.size.height/2));
UIImage *topLeftImage = [UIImage imageWithCGImage:topLeftImageRef];