Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-02-2008, 07:10 PM   #1 (permalink)
cmezak
Registered Member
 
cmezak's Avatar
 
Join Date: Jul 2008
Posts: 207
Default Resizing a photo to a new UIImage

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
cmezak is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,846
Threads: 89,213
Posts: 380,660
Top Poster: BrianSlick (7,129)
Welcome to our newest member, philbert89
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:35 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.