开发者

UIImageView, UIView, taking a segment of a picture

开发者 https://www.devze.com 2023-01-05 00:21 出处:网络
I want to take an image from the UIImagePickerController and put it on a UIImageView that can move based on touch.I\'m not sure how to get the picture ont开发者_如何学编程o the UIImageView.I thought t

I want to take an image from the UIImagePickerController and put it on a UIImageView that can move based on touch. I'm not sure how to get the picture ont开发者_如何学编程o the UIImageView. I thought the UIImageView automatically resizes the picture, so I couldn't grab just the top half of the picture and put that on the UIImageView. Is there an easy way to do this? thanks!


Use CGImageCreateWithImageInRect to crop (take a segment of?) a picture. Put a UIImageView inside a UIScrollView to let the user scroll through (move based on touch) a large image.


if you want to move and zoom your picture in a view, you need to use a UIScrollView. See Apple's ScrollViewSuite example. If you simply want to position the picture within a UIImageView, set the contentMode of the UIImageView to the setting you want e.g. scale, top, left, etc. See the UIImageView documentation for all options.

0

精彩评论

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