Saving Images

Started by
2 comments, last by Badone 22 years, 3 months ago
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.
Advertisement
http://therabbithole.redback.inficad.com/tricks/downloads/screenshot.cpp

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

Ben

Are there any tutorials on this subject because I don''t know how to use ddraw 7 and I''m pretty new to Dx8.
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); 

This topic is closed to new replies.

Advertisement