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

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

问题描述

我正试图找出一种方法来裁剪 UIImage ,因为它是在Photoshop Express中完成的:

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天全站免登陆