Archived

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

Saving Images

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