Skip to content

Instantly share code, notes, and snippets.

@atomicink
Created May 26, 2015 06:29
Show Gist options
  • Save atomicink/61f83a7790004baef7ad to your computer and use it in GitHub Desktop.
Save atomicink/61f83a7790004baef7ad to your computer and use it in GitHub Desktop.
resizeImage
+ (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