Is possible PrintScreen or save in an image some part of the screen?

979 views Asked by At

Is it possible? I need save the sreen and send from iPad to a WebService... Concretly the problem is that i want simulate a sign in the screen and later save this sign in a NSData and send by email.

Some idea?

thanks for all!

Best regards!

1

There are 1 answers

0
ladoch On BEST ANSWER
UIView *view = ...; // Get root view of current view controller

UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

NSData *imageData = UIImagePNGRepresentation(viewImage);