裁剪操作界面:在图像上绘制的用户可调整大小的矩形 [英] Interface for cropping operation: user-resizeable rectangle drawn on image

查看:27
本文介绍了裁剪操作界面:在图像上绘制的用户可调整大小的矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在想办法像在 Photoshop Express 中那样裁剪 UIImage:

I am trying to figure out a way to crop a UIImage as it's done in Photoshop Express:

所以基本上你只需触摸并拖动角来调整矩形的大小,然后点击复选按钮并裁剪图像.现在我已经完成了裁剪部分——我制作了一个从 CGRect 裁剪图像的方法,但是我遇到了这个可调整大小的矩形的问题.我尝试过的一切都没有奏效,这让我发疯,因为我知道这可能只是一件容易的事.有没有人做过类似的事情或知道网络上的一个例子?

So basically you just touch and drag the corners to resize the rectangle, then you tap the check button and it crops the image. Now I have the crop part done -- I made a method that crops an image from a CGRect but I am having problems with this resizable rect. Everything I have tried has not worked, and it's making me crazy, because I know it is probably just something easy. Has anyone ever done anything like this or know of an example on the web?

推荐答案

这里有你正在寻找的自定义控件的源代码.

Here you have the source code for the custom control you are looking.

http://www.cocoacontrols.com/platforms/ios/controls/bjimagecropper

我建议你浏览那个网页 http://www.cocoacontrols.com,你会发现很多示例代码,其中大部分具有开放许可证,因此您可以在自己的应用中使用它.

I recommend you to browse that webpage http://www.cocoacontrols.com, you will find tons of sample code, and most of it has an open license so you can use it in your own app.

希望有帮助!

这篇关于裁剪操作界面:在图像上绘制的用户可调整大小的矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆