Your Ad Here

Posted By

sendoa on 08/19/11


Tagged

resizeimageios


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

garthhumphreys


Resize image on iOS SDK


 / Published in: Objective C
 

URL: http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk

Redimensionar una imagen en el SDK de iOS. Información más extendida en:

http://ofcodeandmen.poltras.com/2008/10/30/undocumented-uiimage-resizing/

  1. + (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize
  2. {
  3. UIGraphicsBeginImageContext( newSize );
  4. [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
  5. UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
  6. UIGraphicsEndImageContext();
  7.  
  8. return newImage;
  9. }

Report this snippet  

You need to login to post a comment.