方法如下:
CGRect rect = CGRectMake(x,y,w,h); //分割子图的区域
CGImageRef imgRef = CGImageCreateWithImageInRect(image.CGImage, rect);
UIImage *imagePart = [UIImage imageWithCGImage:imgRef];
CGImageRelease(imgRef);
方法如下:
CGRect rect = CGRectMake(x,y,w,h); //分割子图的区域
CGImageRef imgRef = CGImageCreateWithImageInRect(image.CGImage, rect);
UIImage *imagePart = [UIImage imageWithCGImage:imgRef];
CGImageRelease(imgRef);