简体   繁体   English

如何从后台窗口 DirectX 获取屏幕截图

[英]How to get a screenshot from the background window DirectX

I was looking for examples of how to make a screenshot of an inactive window, but I did not find it.我正在寻找如何制作非活动窗口屏幕截图的示例,但我没有找到。 I want to take a screenshot of the game that works in the window, and not in full screen mode.我想截取在窗口中运行的游戏的屏幕截图,而不是在全屏模式下。 Which can be blocked by other windows.可以被其他窗口阻止。

I found some examples on the Internet, but could not implement in my project.我在网上找到了一些例子,但无法在我的项目中实现。

Could you set an example of how to do this with the help of EasyHook and SharpDX (or SlimDX) on language C#?您能否举例说明如何在语言 C# 上借助 EasyHook 和 SharpDX(或 SlimDX)来做到这一点?

I'll be very grateful!我将不胜感激!

I created an example project for this on GitHub, https://github.com/spazzarama/Direct3DHook我在 GitHub 上为此创建了一个示例项目, https://github.com/spazzarama/Direct3DHook

Allows screen capture and drawing an overlay into the Direct3D target application using C#, EasyHook and SharpDX.允许使用 C#、EasyHook 和 SharpDX 截屏并在 Direct3D 目标应用程序中绘制叠加层。

Keep in mind that some games will employ anti-injection/hooking techniqiues that may block EasyHook.请记住,某些游戏会使用可能会阻止 EasyHook 的反注入/挂钩技术。

In addition this usually won't work for minimised applications as it is best practice to pause your render loop when minimised.此外,这通常不适用于最小化的应用程序,因为最佳做法是在最小化时暂停渲染循环。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM