简体   繁体   中英

How to crop a non-rectangular region in iOS

I am building a photo sharing app for iOS 5 and I'd like to enable users to trace around some portion of an image and then crop out that selected region. I've looked all around for how to do this, and everyone seems to assume you are trying to crop out rectangular areas. Is there a way to do it for a non-rectangular area?

This answer shows how to copy an image using a path. The answer adds a rectangle to the path, so you would instead add all of the line segments traced out by the user to your path.

I made this cropping tool which fits your need. It gives the user control on the area to crop.

https://github.com/nicholjs/BFCropInterface

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM