Jump to content
  • Advertisement
Sign in to follow this  
efindley

Where did DrawtoDC go? I need an "in memory" screenshot

This topic is 4746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have to state up front that I'm new to DirectX so be gentle if my question is completely stupid. However, I had to jump in with both feet for a project I'm working on. I'm using C# for this particular project, and I realize most people here are probably c++ programmers, but I was hoping someone could help. I know C++, too, so if you can answer my question in C++ I should be able to use the information. :) Using the DirectX 9 sdk (August 2005 update), I've got some fairly simple 3d drawing I'm doing to a panel. I've figured out how to save a screenshot of that panel to a file, but I can't figure out how to get a copy of the data in memory. I want to be able provide a copy to clipboard functionality to my app. I found this nice piece of sample code that looked like exactly what I was looking for, but it used the function DrawToDC function of the Surface class. That function has been deprecated. Is there a replacement? Is there a better way to do this? Thanks for any help you can give.

Share this post


Link to post
Share on other sites
Advertisement
Call D3DXLoadSurfaceFromSurface() with the source surface being your backbuffer or render target surface and the destination being a surface created in system memory. Then you can lock your system memory surface and copy the contents.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!