使用 ALAsset 设置 UIImageView
我有一个 UIImageView 并想将其设置为 ALAsset 的内容。
ALAssets 内容如何用于设置 UIImage?
I have a UIImageView and would like to set it to the contents of an ALAsset.
How is the ALAssets contents used to set a UIImage?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个。顺便说一句,资产是 ALAsset。
Try this. Asset is ALAsset by the way.
正如 Clayton 和 Aaron Brager 所提到的,关键是 UIImage 类的 imageWithCGImage 方法。
有两种方法获取图像内容:
你可以参考 http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference /ALAssetRepresentation_Class/Reference/Reference.html#//apple_ref/doc/c_ref/ALAssetRepresentation 了解更多详细信息。
As mentioned by Clayton and Aaron Brager, the key is imageWithCGImage method of UIImage class.
There are a two ways to get image content:
You may refer http://developer.apple.com/library/ios/#documentation/AssetsLibrary/Reference/ALAssetRepresentation_Class/Reference/Reference.html#//apple_ref/doc/c_ref/ALAssetRepresentation for more details.