简体   繁体   English

iOS-带有圆圈手势的图像裁剪

[英]iOS - Image crop with gesture in circle

I am developing an iOS app in which I need to crop image with finger. 我正在开发一个iOS应用,需要用手指裁剪图像。 Like any one take picture and then can crop any part of image with finger. 就像任何人拍照一样,然后可以用手指裁剪图像的任何部分。 I have searched the Internet but I am getting tools what can crop images into rectangular area. 我已经在互联网上搜索过,但是正在使用一些工具,可以将图像裁剪为矩形区域。 Can anyone please help me to crop image with pan gesture with rough pattern? 谁能帮我用粗糙图案的平移手势裁剪图像吗?

Any help will be much appreciated. 任何帮助都感激不尽。

There is not straight API from apple to help you do that. 苹果公司没有直接的API可以帮助您做到这一点。 You will have to create your own custom mask layer and get the image.graphic context and apply the user created mask to that context your self. 您将必须创建自己的自定义蒙版层并获取image.graphic上下文,并将用户创建的蒙版应用于自己。

You might want to dig deeper into this thread: ImagePicker Library with custom crop rect? 您可能想更深入地研究这个线程: 具有自定义裁剪矩形的ImagePicker库?

我找到了一个提到所有要求的解决方案

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

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