Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize an image in iOS? [duplicate]

Tags:

ios

uiimage

hi I want to send an image to a web service. But I want to resize user selected any image into 75 x 75 and send it to web service. How can I resize this image into 75 x 75

Thanks

like image 757
iDia Avatar asked Sep 10 '25 05:09

iDia


1 Answers

Try to implement the code below. It may be helpful for you:

    CGRect rect = CGRectMake(0,0,75,75);
    UIGraphicsBeginImageContext( rect.size );
    [yourCurrentOriginalImage drawInRect:rect];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
like image 137
Nitin Gohel Avatar answered Sep 12 '25 18:09

Nitin Gohel