2011-10-12 88 views
3

我有UIImageView包含靜態圖像,我想獲取此圖像並將其設置在UIImage變量下。
UIImageView到UIImage

我該怎麼做?

+0

的UIImage *圖像= imageView.image; – Fuggly

回答

10
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在developer.apple.com