Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uaecasher

macrumors 65816
Original poster
hello,

I'm wondering if anyone can tell me how to change the image resolution when it have been picked from uiimagepickercontroller ?

thanks
 
You need to create a new image that is the size you want and then draw the existing image into that image.

There is a generic way to do it via CGBitmapContext but for the iPhone you should use UIGraphicsBeginImageContext, UIGraphicsGetCurrentContext, CGContextDrawImage, UIGraphicsGetImageFromCurrentImageContext, and UIGraphicsEndImageContext.

Edit: I should add, CGContextDrawImage will automatically scale the image to fit whatever rect you pass it.
 
Plus, there are some open-source libraries you can search for that extend the UIImage Class to do image-resizing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.