Yes it is possible. First you should get the UIImageView image using this property:
@property(nonatomic, retain) UIImage *image;
And NSImage:
@property(nonatomic, readonly) CGImageRef CGImage;
Then you will get a sectional image:
CGImageRef cutImage = CGImageCreateWithImageInRect(yourCGImageRef, CGRectMake(x, y, w, h));
If you want UIImage again, you should use this UIImage method:
+ (UIImage *)imageWithCGImage:(CGImageRef)cgImage;
PS: I don’t know how to do this directly, without converting it to CGImageRef, maybe there is a way.
Ramy Al Zuhouri
source share