Is possible PrintScreen or save in an image some p

2019-05-28 23:01发布

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条回答
聊天终结者
2楼-- · 2019-05-28 23:18
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);
查看更多
登录 后发表回答