在第 3 个 imageview 上添加了 2 个 imageview 现在想要将第 3 个 imageviews 图像转换为实际图像

Posted

技术标签:

【中文标题】在第 3 个 imageview 上添加了 2 个 imageview 现在想要将第 3 个 imageviews 图像转换为实际图像【英文标题】:Added 2 imageview on 3rd imageview now want to convert the 3rd imageviews image into an actual image 【发布时间】:2010-12-02 11:31:36 【问题描述】:

我有 3 个图像视图,只需按一下按钮,我就已将这些图像添加到第 3 个图像视图中,就像这样

-(void) loadView

 [super loadView];
 [self.view addSubview:wormimage];
 [self.view addSubview:appleimage];
 [self.view addSubview:finalimage];
 [self.view addSubview:saveButton];
 [self.view addSubview:btn];
 [appleimage addSubview:wormimage];

这是按钮触摸方法

-(void) addImage

 [finalimage addSubview:appleimage];

现在我想知道的是第 3 个图像视图包含 2 个图像视图(appleimage 和蠕虫图像) 我不知道如何将其转换为整个图像本身,必须使用什么才能做到这一点,按钮触摸的最终输出必须是图像,图像的扩展无关紧要。

如何将整个视图转换为图像并将其保存到 iPhone 的图库中?

【问题讨论】:

【参考方案1】:

试试这个:

UIGraphicsBeginImageContext(size)

//Draw the View that you wanted

UIImage *image = UIGraphicsGetImageFromCurrentImageContext()

UIGraphicsEndImageContext

【讨论】:

以上是关于在第 3 个 imageview 上添加了 2 个 imageview 现在想要将第 3 个 imageviews 图像转换为实际图像的主要内容,如果未能解决你的问题,请参考以下文章