Archived

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

Chaucer

saving screenshot

Recommended Posts

I read this article : http://www.gamedev.net/reference/articles/article1844.asp And I tried to modify it to save to a jpg instead of bmp file. It will only save as a bmp. If I change to this: D3DXSaveSurfaceToFile(filename, D3DXIFF_JPG, frontbuf, NULL, NULL); it doesn''t save at all. Do I need a palette or anything to save as JPG or do I just need to get my front buffer in the correct format here: d3dDevice->CreateImageSurface(screenWidth, screenHeight, D3DFMT_A8R8G8B8, &frontbuf); Does anyone know what format it would be? Or is it something else? Thanks.

Share this post


Link to post
Share on other sites
Because D3DXSaveSurfaceToFile()
"... supports the following file formats: .bmp and .dds." (taken from the dx9 sdk documentation.
for image handling I really recommend Dev-IL:
http://openil.sourceforge.net/
Combined with some D3DX functions (e.g. to generate mipmaps or surfaces from graphics in memory) this works quiet well, with much formats supported (all devIL formats)

Share this post


Link to post
Share on other sites