简体   繁体   English

如何允许iPhone用户“移动并缩放”已选择的照片

[英]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? 如何为任何给出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. 我理解如何使用带有allowEditing = YES的UIImagePickerController。 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? 有没有隐藏的方法来使用UIImagePickerController来做到这一点? 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; Theres整个应用专用于自定义图像编辑作为其唯一目的,因此可以完成,但没有预先构建的方式来到允许编辑= YES的图像选择器编辑屏幕; gets you. 得到你。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iPhone:当用户按下已选择的选项卡时,如何使UINavViewController不弹出视图控制器 - iPhone: How do I get the the UINavViewController to not pop the view controller when the user presses the tab that is already selected 如何允许用户缩放图像视图并保持照片质量? - How to allow a user to scale imageviews and retain photo quality? iPhone:如何为从照片库中提取的图像实现“移动和缩放”功能 - iPhone:How to implement “move and scale” functionality for image fetched from photo library 我如何知道UITextField的文本是否已被用户修改 - How do I know if the text of a UITextField has been modified by user 在iPhone上已选择如何更改图像的图标以表示图像 - How to change the icon of an image to represent it has been selected on an iPhone 如何缩放选定的图像iPhone SDK? - How can I scale selected image iPhone sdk? 如何检测何时未选择UITableView表格单元格? - How do I detect when no UITableView table cell has been selected? 如何在iPhone上使用棕褐色调在照片上? - How do I apply a sepia tone to a photo with on the iPhone? 如何使用 iphone 在照片中找到矩形? - How do I find a rectangle in a photo using iphone? 如何在iPhone中使用移动和缩放UIImagePickerController? - How to use move and scale UIImagePickerController in iPhone?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM