Interface for cropping operation: user-resizeable

2019-03-22 08:16发布

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

enter image description here

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?

2条回答
虎瘦雄心在
2楼-- · 2019-03-22 08:30

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!

查看更多
在下西门庆
3楼-- · 2019-03-22 08:34

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

https://github.com/noripcord/Crop

查看更多
登录 后发表回答