Created
May 26, 2015 06:29
-
-
Save atomicink/61f83a7790004baef7ad to your computer and use it in GitHub Desktop.
resizeImage
This file contains 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*) resizeImage:(UIImage*)origImage toSize:(CGSize)newsize { | |
UIGraphicsBeginImageContextWithOptions(newsize, NO, 0.0); | |
[origImage drawInRect:CGRectMake(0, 0, newsize.width, newsize.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