Skip to content

Instantly share code, notes, and snippets.

@takuma104
Created June 23, 2009 10:05
Show Gist options
  • Save takuma104/134464 to your computer and use it in GitHub Desktop.
Save takuma104/134464 to your computer and use it in GitHub Desktop.
+ (UIImage*)resizedImage:(UIImage*)image withSize:(CGSize)size {
UIGraphicsBeginImageContext(size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetInterpolationQuality(context, kCGInterpolationNone);
// CGContextSetInterpolationQuality(context, kCGInterpolationLow);
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment