将UIImageView转换为UIImage [英] Converting UIImageView to UIImage

查看:128
本文介绍了将UIImageView转换为UIImage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理图像,我有大量图像,并且正在从服务器实时下载图像,而AsyncImageView类的确非常快,但是我知道我正在使用自定义图像类,它使用UIImage而不是UIImageView.

I'm working with images, I have tonnes of them, and I'm downloading them in real time from the server, before it was really fast with the AsyncImageView class, but know I'm working with the custom class, that takes UIImage instead of UIImageView.

问题:是否有什么好方法可以将UIImageView转换为UIImage?

Question: Is there any good way to convert UIImageView to UIImage?

提前谢谢!

推荐答案

您不需要在UIImage中显示UIImageView.也许您想在另一个UIImageView中显示一个UIImageView,或者您想访问UIImageView的image属性,可以使用imageView.image进行此操作:

you dont need to show a UIImageView inside a UIImage. Maybe you want to show a UIImageView inside another UIImageView or maybe you want to access the UIImageView's image property, which you can do with imageView.image:

UIImage *imageFromImageView = myImageView.image

或如果其图像视图位于另一个图像视图选项内:

or if its the image view inside another image view option:

[myOuterImageView addSubiew:myInnerImageView];

这篇关于将UIImageView转换为UIImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆