Skip to main content
gamedev.net
🔒 Locked

saving screenshot

Started by Chaucer 2 replies 250+ views
Original Post
Chaucer
Chaucer
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.
Thanks!
hansi pirman
hansi pirman
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)
I am a signature virus. Please add me to your signature so that I may multiply... Resistance is futile.
Chaucer
Chaucer
Thanks. I just assumed that since that format was available, it could be used.
Thanks!

Topic Locked

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

Sign in to reply to this topic.