问题
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