The code below works well but grabs only the UIView which is VISIBLE on your screen.
How can I grab instead a UIView which is not currently displaying?
Thanks!
//Take a screenshot of the view...
UIGraphicsBeginImageContext(View_1.frame.size);
[View_1.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *View_1 = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(View_1, nil, nil, nil);
//...and attach it as an image to the email
NSData *myData3 = UIImagePNGRepresentation(View_1);
[picker addAttachmentData:myData3 mimeType:@"image/png" fileName:@"screenshot2"];
If you mean hidden like in
view.hidden = YES;then you will not be able to draw it, instead of hiding it you can either remove it from the super view, or even callview.hidden = NO;before drawing it and thenview.hidden = YES;after it has been drawnexample