Screenshots

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Screenshots

Post by Boogle »

How do I go about creating a screen capture system? eg. I want to save the current screen image to a file if the F12 button is pressed.
ledzeppelin
Posts: 3
Joined: Wed Oct 29, 2003 1:48 am
Location: Long Beach, California

Post by ledzeppelin »

analogx has a program called capture that captures whole desktops or just opened windows, can save to a predefined file, and features hotkeys that are user definable. Get it athttp://www.analogx.com/contents/downloa ... apture.htm...unless you want to program the same thing yourself!
Boogle
Posts: 162
Joined: Fri Nov 21, 2003 3:16 pm
Location: Toronto, Canada

Post by Boogle »

Yeah I want to program it myself. Like many 3d games currently have a screenshot feature, and I would like to add that to my game.
stampsm
Posts: 142
Joined: Mon Nov 10, 2003 5:52 pm
Location: Las Vegas

Post by stampsm »

i know opengl has a function to render to a offscreen buffer that can then be saved to a file
there is a tutorial here for it in opengl
http://www.ultimategameprogramming.com/ ... nGL&page=2
the only problem is it is for opengl not irrlicht, but it might give you some ideas
Caecus
Posts: 36
Joined: Fri Aug 22, 2003 6:33 am
Location: California, USA

Post by Caecus »

I think it would be best if Niko added this to irrlicht. something like irrDriver->screenToFile("001.bmp"); Since Im not sure if there is a way to code it within the current irrlicht interface (plus having it as a feature would make using it quick and easy)
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

Caecus wrote:I think it would be best if Niko added this to irrlicht. something like irrDriver->screenToFile("001.bmp"); Since Im not sure if there is a way to code it within the current irrlicht interface (plus having it as a feature would make using it quick and easy)
if someone wanted to go that extra mile he could add in the CAviFile class (http://www.codeproject.com/bitmap/createmovie.asp) which would allow the engine to record it's own .avi movie demos :D
Isometric God
Posts: 69
Joined: Sun Oct 12, 2003 3:42 pm
Location: Germany

Post by Isometric God »

Why not save the primary surface to file ? That's easy but dx specific.

Better would be :
- Retrieve window drawing context ( very easy )
- Find bitmap data ( easy )
- Convert bitmap data to jpg or whatever ( don't know )
- Save file ( easy )

The only disadvantage I can see is that it takes a LOT of time to save to file. I guess it could be as much as one second per image. You better not
use that for movie capturing :wink:

I can't see why niko has to do that.... If somebody feels a feature he/she coded might be useful for other users, niko will surely put the stuff into his
code. Just my 2 cents ...
Chev
Posts: 37
Joined: Wed Nov 19, 2003 6:15 am

Post by Chev »

I dont think a delay is unacceptable. Most games tend to freeze momentarily while attempting to capture the screen to a file.
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

Isometric God wrote:The only disadvantage I can see is that it takes a LOT of time to save to file. I guess it could be as much as one second per image. You better not
use that for movie capturing
to speed things up the screen bitmap could be sub-sampled .. it might be possible to get 10 fps or so while recording a movie. if using CAviFile is too slow then the bitmaps can just be saved to sequenced filenames and then stitched together using aviQuick (http://www.bobos.demon.co.uk/par/AVIQuick.htm) at a later time :)
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

It would be a nice feature, and I definately think video capturing or at least making screenshots should be added into the engine. I've thought about a general interface making it possible to write images in different file formats to disk, and an interface for creating a software-image (they are a new feature in 0.4.2) from the current frame buffer. Would be a cool thing if this would be in 0.5. Lets see. :)
Post Reply