Hallo
How does one print a scene (view) generated in Irrlicht?
Thanks
Anton Heymann
Printing
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
If you mean a screenshot, then (presumably triggered by receiving an event):
Just change the file suffix to have it saved in different formats.
Code: Select all
IImage * screenShot = device->getVideoDriver()->createScreenShot();
if (screenShot)
{
stringc name;
name = "screenshots/screenshot-";
name += device->getTimer()->getRealTime();
name += ".jpg";
device->getVideoDriver()->writeImageToFile(screenShot, name.c_str());
screenShot->drop();
}
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Either that or just press the 'print screen' button on your keyboard which copies the screen contents onto the clipboard and then paste it into your most favouritest image editor to save it to a file.
Quicker to get a single screenshot as it doesn't require adding code but if you're going to want to do multiple screenshots in one run of your app then i'd suggest doing what rogerborg said!
Quicker to get a single screenshot as it doesn't require adding code but if you're going to want to do multiple screenshots in one run of your app then i'd suggest doing what rogerborg said!
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Yes, TARGA is supported: just pass a filename with a .tga suffix to writeImageToFile(), and it does it automagically.
I'm not sure what frame rate you'll be able to sustain while dumping that amount of data to the filesystem, but the only way to find out is to suck it and see.
I'm not sure what frame rate you'll be able to sustain while dumping that amount of data to the filesystem, but the only way to find out is to suck it and see.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
well, the issue with printing is that the resolution of a printer area is far bigger than the rendered area, so if you do a screenshot of the existing view and print it, you will have either a very small image or if your resize it, it may be ugly.
i know very few of irrlicht (just beginning with it) but what I've done before in pre OpenGL is to re-render the scene offscreen in a new area with the resolution given by the printer driver and send the rendered image (as screenshot) to the printer.
no idea if it is possible with irrlicht and how.
just my $0.02
Stephane
i know very few of irrlicht (just beginning with it) but what I've done before in pre OpenGL is to re-render the scene offscreen in a new area with the resolution given by the printer driver and send the rendered image (as screenshot) to the printer.
no idea if it is possible with irrlicht and how.
just my $0.02
Stephane