Direct3D Screenshot?

Does anyone know what Direct3D functions I should look at if I wish to be able to take a screenshot of the desktop. I don't really care to get the contents of my application but rather the entire desktop as it is presented to the user.


Answer this question

Direct3D Screenshot?

  • kelly_c

    I think the real question is how to get a handle to the surface that vista is drawing to. D3D itself won't have a function for that since its something that was created by vista. If you can get that handle then I suspect you can use the functions you already know to get the bitmap etc.

    Or maybe Vista has a whole new API for getting the screen shot.



  • henrynp

    Thanks.

    I've reposted this question in the General Windows Vista Development Issues here:
    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=342988&SiteID=1

  • Cosmin Nicolaescu

    Direct3D doesn't have any functions to capture the desktop - it only knows about the surfaces under its control.

    Not sure of the native calls but in .Net its a few lines of code http://tommycarlier.blogspot.com/2006/02/screen-capture-tool.html



  • c_add_nine

    I'm not necessarily interested in a single function to do this operation. I know how to get the render target surface for my own application, and to get it's data into a bitmap file. However, I want to get the render target surface that represents the desktop (perhaps I should mention that I'm wanting this for Vista, since the DWM is a Direct3D application).

    The link provided above does not use Direct3D I belive, but rather GDI (or is it GDI+)

    Anyways, any other help would be useful.

  • Preston32

    Aha Vista, now it makes sense why you would use D3D to grab the desktop. Sadly I don't have a clue about that one... might be worth asking in the Vista groups though.

  • Direct3D Screenshot?