2013-07-02 38 views
1

我有兩個UIImageView一個在另一個上,我想將它們保存在一個單一的文件中相機卷。如何將2個UIImageView保存到一個圖像中

UIImageWriteToSavedPhotosAlbum(self.myimage.image,nil,nil,nil); 
}); 

圖像重疊在一起並且尺寸相同。最上面的一個具有幾個字母才能看到另一個

+1

http://stackoverflow.com/questions/11131050/ios-save-image-to採取截屏-camera-roll – iPatel

+0

http://stackoverflow.com/questions/2560082/how-to-merge-multiple-uiimageviews-into-one-uiimage – iPatel

+0

圖像視圖如何相互關聯?他們是一樣的大小?有很多方法可以將圖像組合起來... – Wain

回答

0

,你可以這樣做......,

添加您都imageview的一個的UIView,然後拿這個的UIView的截屏並保存生成圖像在你想要的目的地。

這裏是代碼通過編碼

// code to take Screen shot 
-(void) takeScreenshot 
{ 
    // Replace self.view with your view name which containing your ImageViews 

    UIGraphicsBeginImageContext(self.view.bounds.size); 
    CGContextRef context = UIGraphicsGetCurrentContext(); 
    [self.view.layer renderInContext:context]; 
    // get a UIImage from the image context 
    UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext(); 
    // clean up drawing environment 
    UIGraphicsEndImageContext(); 

    // Then save your Image in your desired destination 
} 

希望它會幫助你,快樂編碼

+0

它不適用於我可以向我展示Action的完整代碼示例嗎?包括保存部分我的意思是 – kuranes

+0

你能告訴我你的圖像嗎?你重疊? – Dhruvik

相關問題