Take SnapShot and Save in gallery in iphone
canvasView is UIView. if you want to take snapshot of whole screen use self.view.
UIGraphicsBeginImageContext(canvasView.frame.size);
[canvasView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
canvasView is UIView. if you want to take snapshot of whole screen use self.view.
UIGraphicsBeginImageContext(canvasView.frame.size);
[canvasView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
No comments:
Post a Comment