Created
June 23, 2009 10:05
-
-
Save takuma104/134464 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (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