Loading

Friday, September 17, 2010

Resize The Image for Save

NSData *imgdata = UIImageJPEGRepresentation([PhotoArray objectAtIndex:0], 0.85f);
UIImage *image = [UIImage imageWithData:imgdata];
CGRect rect = CGRectMake(0.0, 0.0, 320, 480);
UIGraphicsBeginImageContext(rect.size);
[image drawInRect:rect];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData *imgdata1 = UIImageJPEGRepresentation(img, 0.6);

No comments:

Post a Comment