从剪贴板检索图像作为数组
我已经集思广益了很长时间,似乎可以想出解决这个问题的办法。
场景如下:
目标:允许用户截取屏幕截图(使用截图工具、屏幕截图按钮等),当他们单击我的 html 页面上的按钮时,剪贴板图像就会上传到某个位置。
限制:我只能使用 html、jscript 和 silverlight。 (由于安全原因)
现在我知道您可以使用 jscript 从剪贴板获取文本,并且您可以使用 silverlight 执行相同的操作,但我似乎无法访问图像。 WPF 支持此功能 (ClipBoard.GetImage),但未在 Silverligt 中实现。
有谁知道这个问题的解决方法?
谢谢!
编辑:我找到了一个可能的解决方法,但可以在实现它时使用一些帮助:
我使用 javascript 启动绘画。如果我现在可以执行以下操作: - 将剪贴板粘贴到油漆中 - 在桌面或其他地方另存为 .jpg - =>然后我可以上传这个文件 - 删除文件
I've been brainstorming for a long time now and can seem to come up with a solution for this issue.
Here's the scenario:
Goal: Allow users to take a printscreen (ussing snipping tool, printscreen button, ...) and when they click a button on my html page the clipboard image get's uploaded to a certain location.
Limitations: I can only use html, jscript and silverlight. (due to security reasons)
Now I know you can get text from the clipboard with jscript, and you can do the same with silverlight, but I do not seem to have access when it comes to images. WPF supports this (ClipBoard.GetImage) but this is not implemented in Silverligt.
Does anyone know a workaround for this?
Thanks!
EDIT: I've found a possible workaround, but could use some help in implementing it:
I use javascript to launch paint. If I could now do the following:
- paste the clipboard in paint
- save as .jpg on desktop or whatever
- => i can then upload this file
- delete the file
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,silverlight 目前只允许从剪贴板读取文本,您可以等待 silverlight 5,但我怀疑它会在那里,目前这是不可能的,也没有解决方法。
No, silverlight currently allows only text to be read from the clipboard, you can wait for silverlight 5, but I doubt it will be there and currently it is not possible and there is no workaround.