How to capture desktop on windows so that it would capture both directX and normally rendered parts of screen?

房东的猫 提交于 2019-12-10 22:34:56

问题


Simple example - on one side we see camera rendered via standard software rendered "Input" on other hand (labeled "Output") rendered via some directX stuff (at least it seems to me) :

So what function is provided by windows api or DirectX api for capturing such mixed scenes?


回答1:


TightVNC Server can do it, you may want to look into what they are doing. From a simple glance through their source code it looks like they are creating a virtual screen that mirrors the primary screen. Specifically though, look into the CreateCompatibleDC and CreateDIBSection API's




回答2:


As I known, there is not a direct way to capture DirectX render area, although we can see that on the screen. Because the real render action(aka render instruction) happens in hardware layer. So the API in standard SDK cannot know the finally render result, which lead to the black square.

The only way to do this maybe put your hope on the Render layer(such as DirectX engine) itself can support output interface as well as underlying render action. So I suggest to check some documentation to find if there indeed is.




回答3:


DirectX can present to a limited subsection of the window that you give it, enabling you to create small regions of DX content in larger windows.



来源:https://stackoverflow.com/questions/6236499/how-to-capture-desktop-on-windows-so-that-it-would-capture-both-directx-and-norm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!