Page 1 of 1

How to Dump a Screenshot to an image File (jpg/png)

Posted: Tue Jun 28, 2005 5:02 pm
by fendres
Hi all,
I wondered whether there is a feature to dump a screenshot from within the engine. Background is, that I plan to use Irrlicht as an image generator. Thus I do not need any screen output, yet I need to write out to an image file, say jpg or png. Is that possible at all? Will it still be possible to use the graphics card acceleration abilities?
I didn't find anything when searching the page and the forum. However I wasn't quite sure what to search for. Any information is appreciated.
Thanks
fendres

Posted: Wed Jun 29, 2005 8:08 pm
by fendres
Is this too easy (did I miss something) or too hard?
Doesn't anybody know it?

Posted: Wed Jun 29, 2005 8:48 pm
by NexusInteractive
I highly doubt that you can do this with Irrlicht, but I'm sure there are libraries our there that allow you to do something like that. Or perhaps there is a function in the windows API to take a screenshot of the active window. Try search on the MSDN library (www.msdn.com/library) or Google. :)

Posted: Thu Jun 30, 2005 10:28 am
by Guest
You can save the frontbuffer contents in Direct3D (the procedure is slightly different between DX8 and 9) look on gamedev.net for an example. Then find a way to add that code to irrlicht (shouldn't be too difficult).

I had this working in my own framework in no time, for irrlicht it will be tricker and loose compliance with Opengl and software (unless you also add relevent code for those renderers to also work).

HTH

Posted: Thu Jun 30, 2005 7:39 pm
by puh

Posted: Sat Jul 02, 2005 4:06 pm
by vgmdev
For Windows: Hit "Print Screen" key next to soroll lock and then open up any image program (ms paint) Edit -> Paste. :wink:

Posted: Sun Jul 03, 2005 11:34 am
by Guest
vgmdev wrote:For Windows: Hit "Print Screen" key next to soroll lock and then open up any image program (ms paint) Edit -> Paste. :wink:

not really what was needed as you probably know.. imagine telling an end user to use the old convoluted method ;)