UIImageView to UIImage
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
精彩评论