Skip to content

Instantly share code, notes, and snippets.

@tediscript
Created April 4, 2013 10:09
Show Gist options
  • Select an option

  • Save tediscript/5309261 to your computer and use it in GitHub Desktop.

Select an option

Save tediscript/5309261 to your computer and use it in GitHub Desktop.
- (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
//UIGraphicsBeginImageContext(newSize);
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
[image 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