从剪贴板获取打印屏幕图像
有没有办法从键盘获取打印屏幕图像。举例来说,我有一个图像托管网站,想要一个功能,用户可以粘贴图像并以这种方式简单地托管它。这可能吗?
抱歉,这是一个如此模糊的问题。
编辑:是否可以使用某种第三方插件?是否有任何现有的 Firefox 插件可以执行类似的操作?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看起来将会在 HTML 5 中使用
Canvas
元素成为可能。请参阅这个问题。这在Flash中似乎不可能,但在Adobe Air中是不可能的。请参阅此问题。
It looks like it's going to be possible in HTML 5 using the
Canvas
element. See this question.It doesn't seem to be possible in Flash but in Adobe Air. See this question.
签名Java 小程序可以访问剪贴板。看一下
ClipboardService
接口。用户第一次加载页面时,他们将看到一个消息框,请求访问剪贴板的权限。
更新我刚刚发现小程序不需要需要签名才能使用
ClipboardService
,尽管用户仍然会看到警告消息第一次。A
signedJava applet can access the clipboard.Take a look at the
ClipboardService
interface.The first time the user loads the page they will see a message box asking for permission to access the clipboard.
Update I just discovered that the applet does not need to be signed in order to use the
ClipboardService
, though the user still sees the warning message the first time.不,据我多年来对 Javascript 和 Flash 的了解,这是不可能的。 Flash 和 JavaScript 都不允许您深入了解系统。 (另外,如果他们可以随意读取我的剪贴板,我作为用户不会喜欢它!)
No, as far as I know from years of knownledge of Javascript and Flash, this is not possible. Both Flash and JavaScript just don't let you dig deep enough into the system. (Also, I as a user wouldn't like it if they could read my clipboard at will!)
我有一个小程序可以做到这一点。
用户点击打印屏幕,小程序从剪贴板复制图像,对其进行格式化并上传到服务器。
这是从 CB 获取它的类,如果您想要其余部分格式化并上传到服务器,请告诉我。
I have an applet that does exactly this.
User hits print screen, applet copies the image from the clipboard, formats it and uploads to the server.
Here is the class that grabs it from the CB, if you want the rest that formats and uploads to the server let me know.
执行此操作的两个产品是 Jira 和 Youtrack。两者都使用 Java Applet。
您可以在制作系统时使用这些产品 GUI 作为灵感。
我特别喜欢 YouTracks 剪贴板中的图像,无需预览,您无需这样做直接与小程序交互。
Two products that do this is Jira and Youtrack. Both by using a Java Applet.
You can use those products GUI as inspiration when making your system.
I especially like YouTracks Image from Clipboard Without Preview where you don't need to interact with the applet directly.