是否可以打印屏幕或将屏幕的某些部分保存在图像中?

发布于 2024-12-28 00:08:29 字数 132 浏览 4 评论 0原文

是否可以?我需要保存屏幕并从 iPad 发送到 WebService...具体问题是我想在屏幕上模拟一个标志,然后将此标志保存在 NSData 中并通过电子邮件发送。

有什么想法吗?

谢谢大家!

此致!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷离° 2025-01-04 00:08:29
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);
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);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文