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

uaecasher

macrumors 65816
Original poster
Jan 29, 2009
1,289
0
Stillwater, OK
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.