This is crazy. I know there are threads that touch on this already, but none of them have led me to the answer. I can't believe that it is really this difficult!
I want to get an image from the camera via UIImagePicker and resize the image so I can use it in my app. Fullsize images from the camera are far too large to hold in memory in large numbers. I can handle the ImgePicker fine. But once I get the fullsize image from it, I need to resize the image.
For the life of me, I can't figure out how to accomplish this simple task.
From what I've read so far, I have to do some quartz2d programming using bitmatcontexts and transforms. The results so far are not good. even when I can get an image out of the other end of my code, it is not oriented correctly or it is stretched the wrong way. If I attempt to apply more transforms to fix the problem, I'm thwarted again.
I know this is a rant and a cop out, but could someone help me get to a simple function that look like this:
Code:
- (UIImage *)resizeImage:(UIImage *)original (CGSize)newSize {
* * * MAGIC * * *
return resizedImage (not resized and stretched or resized and rotated!)
}
I'd post some of my own code, but it is mostly hacked up versions of code I've found elsewhere on the net. I'm a fine iPhone programmer, but I've never dealt with low-level image stuff. I hoped that such a simple task as resizing an image would not be so difficult!
- Charlie