Posted By

mracoker on 02/10/10


Tagged

image down scale


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

umang_nine
cnathan


Scale Down Image


 / Published in: Objective C
 

  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  

You need to login to post a comment.