Sze Wong

Get a snapshot of the image in the current view

Get a snapshot of the image in the current view

Are you trying to save an image of your active UIView into a file or the photo library? If so, here: UIGraphicsBeginImageContext(pictureView.bounds.size); [pictureView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil); pictureView is the UIView that you want to save. Sze Wong Zerion
1 min read