开发者

UIImageView to UIImage

开发者 https://www.devze.com 2023-04-12 08:47 出处:网络
I have UIImageView contains static image, I want to get this image and set it under开发者_开发百科 UIImage variable.

I have UIImageView contains static image, I want to get this image and set it under开发者_开发百科 UIImage variable.

How can I do that?


UIImageView *imageView = ... // Set from somewhere

UIImage *image = imageView.image; // Get the UIImage.
UIImage *otherImage = [UIImage imageNamed:@"Icon.png"]; // Load another image.
imageView.image = otherImage; // Change in the image in your UIImageView.

UIImageView Class Reference at developer.apple.com

0

精彩评论

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

关注公众号