Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 815
Houranis Avatar asked Dec 13 '22 08:12

Houranis


1 Answers

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

like image 189
odrm Avatar answered Jan 12 '23 23:01

odrm