覆盖(?)形式在 JING 中如何工作

发布于 2024-09-09 22:23:11 字数 155 浏览 7 评论 0原文

好的,谁能解释一下Jing如何用覆盖形式截取屏幕截图?看起来它会拍摄全屏截图并记录所有可见的窗口句柄,并让您在表单中选择特定的 hwnd。可能是真的吗?如果是,实现这一目标需要采取哪些重大步骤?可能是一个简单的图片框或没有自定义控件,我在拍摄屏幕截图时没有机会冻结屏幕?

谢谢你!

OK, anyone can explain how Jing take screen shots with that overlay form? It appears that it take a full screen shot and records all visible window handles and let you select within the form a specific hwnd. could be true? if is, what are the big steps to achieve this? could be a simple picturebox or without a custom control i don't have a chance to freeze the screen while taking a screen shot?

Thank you!

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

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

发布评论

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

评论(1

戏蝶舞 2024-09-16 22:23:11

我对Jing不太熟悉,不知道它到底有什么用途。但有两种基本技术。一种是正如您提到的,捕获屏幕并以最顶层的无边框形式显示它。 Vista/Win7 截图工具就是这样工作的。您可以在我的答案中找到开始此操作所需的代码此线程

另一种可能更可能被 Jing 使用,类似于 Spy++ 所做的,允许用户移动鼠标并在窗口周围绘制一个选择矩形。它的优点是,当您运行该工具时,它可以处理窗口大小调整或消失的情况。您可以通过使用屏幕大小的最顶层窗体来实现它,并将其 TransparencyKey 属性设置为 BackColor 的值。紫红色是一个流行的选择。您可以使用 OnPaint() 方法在此窗体上绘图,绘图将显示在所有窗口的顶部。您需要一些 P/Invoke (GetWindow) 来按 Z 顺序迭代底层窗口,以了解用户指向哪个窗口。 GetWindowRect() 获取窗口矩形。再加上处理关于边框尺寸的 Aero 的一些麻烦。

您可以在我的回答中找到示例代码来开始使用该技术 此线程

I'm not familiar enough with Jing to know exactly what it uses. But there are two basic techniques. One is as you mention, capture the screen and display it in a topmost borderless form. The Vista/Win7 Snipping tool works that way. You'll find the code you need to get this started it in my answer in this thread.

The other, perhaps more likely to be used by Jing, is similar to what Spy++ does, allowing the user to move the mouse and draw a selection rectangle around the window. Its advantage is that it can deal with windows resizing or disappearing while you've got the tool running. You implement it by using a topmost form the size of the screen that has its TransparencyKey property set to the value of the BackColor. Fuchsia is a popular choice. You can draw on this form with the OnPaint() method, the drawing appears on top of all the windows. You'd need some P/Invoke (GetWindow) to iterate the underlying windows in their Z-order to know which window the user is pointing at. GetWindowRect() to get the window rectangle. Plus some hassle to deal with Aero lying about the border size.

You can find sample code to get you started on that technique in my answer in this thread.

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