Thursday, November 15, 2012

Take SnapShot and save in gallery in iphone

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);

No comments:

Post a Comment