2009-04-14 40 views

回答

43

找到解決方案。可能幫助某人。要將當前視圖保存爲圖像,請執行以下操作:

UIGraphicsBeginImageContext(pictureView.bounds.size); 
          

[pictureView.layer renderInContext:UIGraphicsGetCurrentContext()]; 

UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); 

UIGraphicsEndImageContext(); 

UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); 
+10

添加#import 以使用此代碼。 – Tyler 2009-08-20 09:39:20