在拍摄之前通知或检测屏幕截图?

发布于 2024-08-19 02:42:31 字数 145 浏览 2 评论 0原文

是否有通知或其他机制通知用户正在使用主页/电源按钮进行屏幕截图?

我看过关于想要禁用屏幕截图的帖子,但这不是我想要做的。

我有一个摄影师客户,他担心他的作品会被用户截图的方式复制,我想如果有机会在截图之前在图像上添加水印,那就可以减轻他的恐惧。

Is there a notification or other mechanism of being informed that the user is taking a screenshot with the home/power buttons?

I've seen threads about wanting to disable the taking of screenshots, but that's not what I'm looking to do.

I have a photographer client who's concerned that his works will be copied by means of users taking screenshots and I thought that if there was an opportunity to put a watermark across the image before the screenshot was taken, that would allay his fears.

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

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

发布评论

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

评论(4

很快妥协 2024-08-26 02:42:31

当用户截取屏幕截图时,将发送 PictureWasTakenNotification Darwin 通知。但是,这是在截取屏幕截图之后发送的。

(在截取屏幕截图之前不会发送任何通知。)

The PictureWasTakenNotification Darwin notification will be sent when the user takes a screenshot. However, this is sent after the screenshot is taken.

(No notifications will be sent before the screenshot was taken.)

溺ぐ爱和你が 2024-08-26 02:42:31

这是一种可能有效的方法,尽管我确信它完全违反用户界面指南。如果您强迫用户将手指放在屏幕上以显示图像,那么我认为他们无法创建屏幕截图。因为一旦你按下 home+lock 键来实际截图,屏幕的表现就好像没有手指触摸它一样。尝试在主屏幕之间移动时截取屏幕截图,看看我的意思。

无论如何,这都不是一个完美的解决方案,但如果您真的很聪明,您也许可以将其应用到您的应用程序设计中,而不会对用户体验造成太大影响(尽管这是一个艰巨的挑战!)。尽管如此,我相信这可能允许您显示艺术品/照片,而不允许用户截取屏幕截图。

Here's a way which might work, although it will totally go against user interface guidelines I'm sure. If you force the user to have their finger on the screen for the image to show then I don't think they can create screenshots. Because as soon as you press the home+lock keys to actually take the screenshot, the screen seems to behave as if there are no fingers touching it. Try taking a screenshot while moving between home screens to see what I mean.

Not a perfect solution by any means but you may be able to work it into your app design if you're really clever without it detracting too much from the user experience (a tough challenge though!). Nevertheless, I believe this may allow you to display artwork/photos without allowing users to take screenshots.

潦草背影 2024-08-26 02:42:31

从 iOS 7 开始,UIApplicationUserDidTakeScreenshotNotification 就存在了。所以做这样的事情应该检测屏幕截图:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidTakeScreenshot) name:UIApplicationUserDidTakeScreenshotNotification object:nil];
}

- (void)userDidTakeScreenshot {
    // Screenshot taken, act accordingly.
}

最后,不要忘记删除观察者:

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil];
}

Since iOS 7 the UIApplicationUserDidTakeScreenshotNotification exists. So doing something like this should detect the screenshots:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidTakeScreenshot) name:UIApplicationUserDidTakeScreenshotNotification object:nil];
}

- (void)userDidTakeScreenshot {
    // Screenshot taken, act accordingly.
}

Finally, don't forget to remove the observer:

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil];
}
怀里藏娇 2024-08-26 02:42:31

真正需要的是在实际屏幕捕获发生之前发送的通知。委托方法或其他一些方法可以让应用程序有机会在抓取发生之前重新绘制内容。

而且没有一个。

What's really needed is a notification that is sent before the actual screen capture happens. A delegate method or some other means of giving the app a screenshotting-in-flight opportunity to redraw your content before the grab happens.

And there isn't one.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文