开发者

User Select and Crop UIImageView

Hey guys, I have a little issue here. I need my users to be able to select 4 different points in an image, and then, based on those points, draw a rectangle and crop the image to that rectangle.

Now, I've tried the method in UIImagePickerView that let's you edit the image, but I find it's very limited, and isn't exactly perfect for my needs.

I think I'd be able to handle the cropping to the rectangle part, since there seems to be lots of documentation o开发者_如何学运维n the internet about that. But after searching, I still can't find a good way for a user to draw a rectangle (or a shape, for that matter) on a UIImageView.

Any help is appreciated!

Thanks


I recommend you implement your own view (subclass of UIView) that draws a rectangle based on the user's touches and gestures. Except for the rectangle outline, it should be transparent so it can be used as an overlay of the UIImageView.

Your view class mainly implements/overrides drawRect:. This is where you draw the rectangle.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜