Screenshots
Screenshots
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.
-
- Posts: 3
- Joined: Wed Oct 29, 2003 1:48 am
- Location: Long Beach, California
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!
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
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
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 demosCaecus 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)
-
- Posts: 69
- Joined: Sun Oct 12, 2003 3:42 pm
- Location: Germany
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
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 ...
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
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 ...
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 timeIsometric 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
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.