屏幕捕获功能覆盖
我想要做的是用 C# 编写一个应用程序,例如“fraps”和其他屏幕捕获应用程序,当您按“打印屏幕”时,它将当前屏幕保存为图像。
我想到的是
“我可以创建一个后台工作线程,在 x 秒后检查剪贴板,如果有图像,由于打印屏幕单击而现在位于剪贴板中,它将剪贴板内容写入 jpeg 或位图文件“但是我缺乏以下知识
我如何知道剪贴板或某些文本或文件中有图像
如何将该剪贴板写入图像文件,例如如何将该数据转换为 JPEG(LZ-W 格式)或位图格式等。
任何人都可以从 C# 编码角度为我提供一些知识或指导或帮助吗
what i want to do is write an application in C# like "fraps" and other scren capture apps that when you press the "Print Screen" it saves the current screen as an image.
What i thought of is that
"i could create a background worker thread that checks the clipboard after x seconds and if there is an image, that is now in clipboard because of print screen click, it writes the clipboard contents to a jpeg or bitmap file" bu i lack the following knowledge
How will i know that there is an image in clipboard or some text or file
how to write that clipboard to an image file like how to convert that data into a JPEG (LZ-W format) or bitmap format etc.
Can anybody endow me with some knowledge or guide or help from C# coding prespective
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 Image 类,保存为特定格式非常容易:
就检查剪贴板而言,您可以做到这一点,但我认为您可能会遇到问题,您不知道图像是否来自 Print-屏幕,或用户按下 Ctrl-c。但是您可以轻松检查剪贴板:
The saving to a particular format is incredibly easy thanks to the Image class:
As far as checking the clipboard, well you can do this, but i think you might run into issues that you won't know whether the image came from a Print-Screen, or from a Ctrl-c that the user did. However you can easily check the clipboard: