How to capture a region from the desktop with the D3D app hidden

Started by
0 comments, last by Mari_p 17 years, 5 months ago
Hello friends, I already captured the frontbuffers of D3D applications and saved them to files. This can be easily made by using CreateOffscreenPlainSurface, GetFrontBufferData and D3DXSaveSurfaceToFile functions. Suppose now my D3D application is minimized or hidden. How could I use Direct3D to capture a region from the desktop (to a surface or a texture)? Actually, I would like to capture the desktop area that corresponds to the window area when it is hidden. (please notice that I don't want to get a screenshot of my application). Thanks in advance
Advertisement
Ops... I had not noticed that the GetFrontBufferData function could get the entire desktop area. I was think it could only capture the window area.

So, the problem can be solved by hiding the app window and capturing its desktop rect.

Anyway, if someone knows a better way to capture to texture, please I would like very much to know. I'm doing these steps:

1) Create the texture
2) Create a off-screen surface and load it with the desktop captured area
3) Get a surface from the texture (GetSurfaceLevel)
4) Copy the off-screen surface to the texture surface (UpdateSurface)

Thanks again

[Edited by - Mari_p on November 18, 2006 1:35:38 PM]

This topic is closed to new replies.

Advertisement