简体   繁体   English

如何在iPhone中将许多图像保存为单张图像?

[英]How to save many images as i single image in iphone?

I have an application where users add several images to view as sub views to show a complete image. 我有一个应用程序,用户在其中添加几个图像以子视图的形式显示完整的图像。 Now i want to show that complete image in other class's image view.How can i do it because that complete image is just an image over another image and not a full single image. 现在我想在其他班级的图像视图中显示完整图像,我该怎么做,因为该完整图像只是另一个图像上的图像,而不是完整的单个图像。

You can programmatically get the complete image of what is displayed on view. 您可以以编程方式获取视图上显示内容的完整图像。 Here is a link to show how to do that http://www.icodeblog.com/2009/07/27/1188/ 这是显示如何执行该操作的链接http://www.icodeblog.com/2009/07/27/1188/

and then you pass the image to your next controller. 然后将图像传递给下一个控制器。

    UIGraphicsBeginImageContext(firstImage.size);
    [firstImage drawAtPoint:CGPointMake(0,0)];
    [secondImage drawAtPoint:CGPointMake(0,0)];

    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM