Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Screen shot of the rendering device

Author
Message
JDforce
20
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 23rd Oct 2007 01:47 Edited at: 23rd Oct 2007 02:12
I need to get a screen shot of the game window at a certain time. Not the desktop, but my game window only. While looking what to do I found the dbGetBackbuffer() which returns a pointer, but I confess to ignore how to extract an image bitmap by using that pointer value. Actually if there is another way it does not matter as long as it captures the window render in a very fast manner.
Please if anybody knows how to do it, I will be very glad.

What will be best is to obtain a bitmap in memory, instead of a saved one.

May the 3d force B with U
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Oct 2007 02:46
JDforce
20
Years of Service
User Offline
Joined: 27th Jul 2004
Location: Sea of Tranquility
Posted: 23rd Oct 2007 06:17
Yes, saving a Bitmap of the current render will partially solve the problem, but since anyway I have to use the bitmap in the program, it would be faster to stream it to memory.

How do you save to a bitmap? I must have skipped that..

May the 3d force B with U
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Oct 2007 16:08
Ok - maybe I was thinking this: Get Image I think you can image pretty easy.

The other means to this end would be the Win API (DLL you can call I'm sure) that does what hitting the "Print Screen" key does - kinda - it drops the current "Display" into the ClipBoard. The API calls should allow you to get a Display VDC - (Video Display Context - pointer I think) and maybe this route has a way you could copy it to a memblock.

This is where C++ pointers are cool. You could simply Get the pointer - allocate mem for it - and call a memcpy command which goes pretty fast to your "Save spot" though this is potentially a lot of data - depending on screen res etc.

Login to post a reply

Server time is: 2024-11-16 20:30:26
Your offset time is: 2024-11-16 20:30:26