问题
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:
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);
来源:https://stackoverflow.com/questions/8927227/is-possible-printscreen-or-save-in-an-image-some-part-of-the-screen