I wanted to resize a UIImage to a certain width and height keeping the proportion in place. The simplest way to do this is:
CGSize newSize = CGSizeMake(726,
Here is a simple way:
UIImage * image = [UIImage imageNamed:@"image"];
CGSize sacleSize = CGSizeMake(10, 10); // scale image to 10 x 10
UIGraphicsBeginImageContextWithOptions(sacleSize, NO, 0.0);
[image drawInRect:CGRectMake(0, 0, sacleSize.width, sacleSize.height)];
UIImage * resizedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
resizedImage is a new image.