Scale Down Image


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. + (UIImage*)imageWithImage:(UIImage*)image
  2. scaledToSize:(CGSize)newSize;
  3. {
  4. UIGraphicsBeginImageContext( newSize );
  5. [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
  6. UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
  7. UIGraphicsEndImageContext();
  8.  
  9. return newImage;
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.