Created
March 13, 2014 08:15
-
-
Save hachinobu/9524141 to your computer and use it in GitHub Desktop.
UIImageのリサイズ方法
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のリサイズ | |
- (UIImage *)resizeImage:(UIImage *)image rect:(CGRect)rect | |
{ | |
UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0); | |
[image drawInRect:rect]; | |
UIImage *resizedImage = UIGraphicsGetImageFromCurrentImageContext(); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetInterpolationQuality(context, kCGInterpolationHigh); | |
UIGraphicsEndImageContext(); | |
return resizedImage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment