【问题标题】:Added 2 imageview on 3rd imageview now want to convert the 3rd imageviews image into an actual image在第 3 个 imageview 上添加了 2 个 imageview 现在想要将第 3 个 imageviews 图像转换为实际图像
【发布时间】: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 的图库中?

【问题讨论】:

    标签: ios objective-c uiimageview


    【解决方案1】:

    试试这个:

    UIGraphicsBeginImageContext(size)
    
    //Draw the View that you wanted
    
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext()
    
    UIGraphicsEndImageContext
    

    【讨论】:

      猜你喜欢
      • 2020-04-15
      • 2020-04-02
      • 2023-03-18
      • 2015-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多