a UIView is created, and little snow .png is added and removed in the UIView to simulate the effect of snow.
Then I would like to capture the screen as an image.
UIGraphicsBeginImageContext(self.uiviewPreview.bounds.size); [self.uiviewPreview.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
Note: self.uiviewPreview is a UIView.
But I can only see the image in UIview in the saved jpg. But all added subitems are not saved at this moment.
I would like to know if renderInContext is correct or not to use
source share