Interface for cropping operation: user-resizeable rectangle drawn on image

不羁岁月 提交于 2019-12-09 07:16:21

问题


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

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?


回答1:


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

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

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.

Hope that helps!




回答2:


Made a project that could be useful. Check it out:

https://github.com/noripcord/Crop



来源:https://stackoverflow.com/questions/11406573/interface-for-cropping-operation-user-resizeable-rectangle-drawn-on-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!