Origamiguy
Origamiguy

Reputation: 1324

Resize an Image file?

I'm writing an iPhone app. I want a UIImagePicker control to come up when the app is launched. When the user selects an image, I want to resize that to being 512x512 with the original image just in the top-left. I then want to save it to a new file in my app's folder.

How do I achieve this?

Upvotes: 0

Views: 696

Answers (1)

Jordan
Jordan

Reputation: 21770

First, you add a view to one of the default iPhone templates of your choosing. Then add a UIImagePicker to that view. Use one of the UIImagePicker delegates to resize the image and save to the file system. Then dismiss the UIIPickerView and load a new view with the new picture, and the original UIIPickerImage in the top left.

That's how you do it, and that answers your question.

Upvotes: 2

Related Questions