I am having the images of size 1200x1200.(getting from server).how can i reduce it to 800x800(without using "Preview").because of the large image size , my app getting crashed..pls help me to solve this...thanks in advance.
UIImage *image = [actualImage you want to resize];
UIImage *tempImage = nil;
CGSize targetSize = CGSizeMake(196,110);
UIGraphicsBeginImageContext(targetSize);
CGRect thumbnailRect = CGRectMake(0, 0, 0, 0);
thumbnailRect.origin = CGPointMake(0.0,0.0);
thumbnailRect.size.width = targetSize.width;
thumbnailRect.size.height = targetSize.height;
[image drawInRect:thumbnailRect];
tempImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
You can use this tempImage , it will be resized Image
Hope, it helps !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With