Skip to main content
gamedev.net
🔒 Locked

Saving Images

Started by Badone 2 replies 200+ views
Original Post
Badone
Badone
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.
Badone
Badone
Are there any tutorials on this subject because I don''t know how to use ddraw 7 and I''m pretty new to Dx8.
Badone
Badone
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);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.