2009-04-14 6 views

Répondre

43

Trouvé la solution. Pourrait aider quelqu'un. Pour enregistrer la vue en cours en tant qu'image, procédez comme suit

UIGraphicsBeginImageContext(pictureView.bounds.size); 
          

[pictureView.layer renderInContext:UIGraphicsGetCurrentContext()]; 

UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); 

UIGraphicsEndImageContext(); 

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

Ajoutez #import pour utiliser ce code. – Tyler

Questions connexes