Jump to content
  • Advertisement
Sign in to follow this  
paulpl2

Screenshot & directx

This topic is 3633 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

Hi, I need to take screenshot from some game. I never used Directx before. I will be grateful if you could help me. Im using C++ Builder, I've downloaded DXSDK from MS. Using implib i've made d3dx9.lib from d3dx9_33.dll and add it to my project. Code for screenshot i have found at Internet: IDirect3DSurface9* pSurface; g_pd3dDevice->CreateOffscreenPlainSurface(Screen->Width, Screen->Height, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL); g_pd3dDevice->GetFrontBufferData(0, pSurface); D3DXSaveSurfaceToFile("Desktop.bmp",D3DXIFF_BMP,pSurface,NULL,NULL); pSurface->Release(); When Im trying to make screenshot i get "Access Violation". For sure im doing something wrong :) But what?

Share this post


Link to post
Share on other sites
Advertisement
That code is for taking a screenshot from your own application. As for the access violation, you need to make sure that the D3D objects are created before calling their methods.

It is not trivial to take screenshots from other apps, especially if you have no experience in D3D itself.

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!