Κυριακή, 12 Μαΐου 2013

uiimage compress


- (UIImage*)imageWithImage:(UIImage*)image
              scaledToSize:(CGSize)newSize;
{
    UIGraphicsBeginImageContext( newSize );
    [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return newImage;
}


CGRect rect = CGRectMake(0.0, 0.0, 480, 720);
image = [self imageWithImage:image scaledToSize:rect.size];


480x720 are printable and near to 0.8MB

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου