如何将多个UIImageViews合并成一个UIImage [英] How to merge multiple UIImageViews into one UIImage
问题描述
我有2个UIImageViews放在彼此的顶部(图片+重叠框架),我想把它们保存到相机胶卷作为1张图片。
I have 2 UIImageViews laying on top of each other ( picture + overlay frame ) and I want to save them to the camera roll as 1 picture.
我合并这2个UIImageViews,以便我可以调用UIImageWriteToSavedPhotosAlbum函数,使用'result'UIImage?
How should I combine those 2 UIImageViews so that I can call the UIImageWriteToSavedPhotosAlbum function, using a 'result' UIImage?
推荐答案
现在有我的Mac附近,但我已经这样做了。
该过程是将 UIImageView
转换为位图上下文,然后创建一个 CGImage
从该上下文,您可以使用创建一个新的 UIImage
从。
阅读 CGBitmapContext
,包括 CGBitmapContextCreateImage
I don't have my Mac nearby at the moment, but I have done this before.
The process is that you'll render the UIImageView
s into a bitmap context, then create a CGImage
from that context that you can use to create a new UIImage
from.
Read up on CGBitmapContext
, including CGBitmapContextCreateImage
这篇关于如何将多个UIImageViews合并成一个UIImage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!