简体   繁体   中英

How do I allow an iPhone user to “Move and Scale” a photo that has already been selected

I am trying to replicate the functionality that users see when they go into edit mode for a contact for which they have already selected a photo, and then click that contact's photo. An action sheet slides up, with options including "Take Photo", "Choose Photo", and "Edit Photo". When you select "Edit Photo", a view comes up that shows the previously selected photo, with "Move and Scale" on top of it, and Cancel and Choose buttons at the bottom. How do I show this "Move and Scale" view for any give UIImage?

To make it clear - I already have "Take Photo" and "Choose Photo" working. And I understand how to use the UIImagePickerController with allowsEditing=YES. I am talking about the situation where the user has already chosen a photo, and later (perhaps days or weeks later) decides they want to edit that photo. In that case, I want to bring up the "Move and Scale" view, just as can be done in Contacts.

Is there a hidden way to use the UIImagePickerController to do this? Or some other built-in method? Or would I need to build this view myself? If I need to build it myself, any pointers?

Thanks!

There is no set way to do this. You would have to roll your own. Theres entire apps dedicated to custom image editing as their sole purpose, so it can be done, but no prebuilt way to get to the image picker editing screen that allowsEditing = YES; gets you.

您可以使用新的Assets Library API将图像保存到照片库,然后启动UIImagePicker并指示用户选择有问题的图像并进行gol-darnit这次编辑......但这非常难看。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM