Of course as soon as you post you find the answer elsewhere...
For those looking I found it here
Cropping an UIImage
The code I used is basically the same but I add it to UIImage to make things easy
Here it is for those interested
//The .h file
@interface UIImage (crop)
- (UIImage *)crop:(CGRect)rect;
@end
Main File
//The .m file
@implementation UIImage (crop)
- (UIImage *)crop:(CGRect)rect {
if (self.scale > 1.0f) {
rect = CGRectMake(rect.origin.x * self.scale,
rect.origin.y * self.scale,
rect.size.width * self.scale,
rect.size.height * self.scale);
}
CGImageRef imageRef = CGImageCreateWithImageInRect(self.CGImage, rect);
UIImage *result = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:self.imageOrientation];
CGImageRelease(imageRef);
return result;
}
@end
Calling it very easy now.
Here's a sample :)
UIImage *image = [UIImage imageNamed:@"imgMap.png"];
CGRect frame = CGRectMake (0, 0, 40, 40); //Change this to whatever the frame should be
UIImage *cropped = [image crop:frame];