Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Badone

Saving Images

This topic is 6044 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''ve been looking through msdn for a while and searching online but haven''t found anything yet. I''m trying to make a tile ripper for the game that I''m working on so the artists that have made the worlds don''t have to manually make them into tiles. I''m going to use rects I guess and copy the tiles from a lot of maps to a single surface. What I''m wondering though, is how do I save a surface to a bitmap file? I know you can sure load bitmaps from a lot of different ways, but how do you save them? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
http://therabbithole.redback.inficad.com/tricks/downloads/screenshot.cpp

It uses DirectX 7. Switching it to any version is easy.

Ben

Share this post


Link to post
Share on other sites
Are there any tutorials on this subject because I don''t know how to use ddraw 7 and I''m pretty new to Dx8.

Share this post


Link to post
Share on other sites
Ok, I got it working by doing this, if anyone else needed to do something like this:

g_pDevice->CreateImageSurface(800, 600, D3DFMT_A8R8G8B8, &g_pSurface);
g_pDevice->GetFrontBuffer(g_pSurface);
D3DXSaveSurfaceToFile("screenshot.bmp",D3DXIFF_BMP,g_pSurface,NULL,NULL);

Share this post


Link to post
Share on other sites

  • 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!