Click to See Complete Forum and Search --> : Capture DOS Screen


walllh
March 27th, 2003, 03:40 PM
Does anyone out there have any code for capturing a DOS screen to a bitmap or gif file. This would be kind of complex because it would require writing a TSR the can grab the screens data but then also save it to a BMP or GIF file in which could require some a lot of code itself. I would just start writing code and try to figure it out on my own which could take a while but I am sure since DOS hasn't been used in a long time that someone a long time ago must have created something like this.
I wrote a program a long time ago that was a TSR and was just basically a screen saver. I had to figure out how to write TSRs and also how to save the data on the screen. My code would then change the screen but as soon as the mouse would move the TSR would write the original screen back.
If anyone has code that can do this or maybe even code from several different programs that might be able to be pieced together to do this it would be greatly appreciated. Thanks in advance.

Mouse_103
March 22nd, 2004, 10:44 AM
why no one helps this person for months.

someone help him.

ferox
March 25th, 2004, 02:18 AM
why no one helps this person for months.

someone help him.


Why don't you...

JMS
March 25th, 2004, 01:09 PM
If you hit alt-printscreen it will capture the entire window to a bitmap and place that bitmap in the clip board....

You can get a bitmap of the command window by giving it the focus and then hitting cntrl-printscreen keys.

Then of course you can go into paint and past the clib board image into a new bitmap image and save it to a file...

Don't know how you could do it programatically though..

Used to be way back in the day we would just read the character buffers and save that to a file for screen captures in character mode....

Joe Nellis
March 25th, 2004, 07:19 PM
I thought TSRs were only used on non-preempting systems like windows 3.0. Who still uses this?

JMS
March 26th, 2004, 10:09 AM
I thought TSRs were only used on non-preempting systems like windows 3.0. Who still uses this?


Actually TSR's were most widely used with non-preempting systems like DOS. Because they staked out memory they would often cause windows 3.0 and windows 3.1 to caugh up a fur ball all over your key board when the memory manager dry beached itself on the used block of memory. We called it Trap-D before Microsoft graced us with the blue screen of death.

Either way the Alt-PrintScrn and Ctrl-printscrn keystrokes wasn't and isn't a TSR. It's a built in feature of all of the Windows OS's dating back to the early days. It's still around in XP, NT, and 2000. Don't know about 2003 but I suspect it's there. Power user trick for non programmers which comes in handy every now and then for reports, manuals and such.

DevLip
March 26th, 2004, 11:15 AM
Ok I have no idea how to do this but it might be easier to redirect the output to a file and then after the fact build a gif file with this text file.

LJHW
March 26th, 2004, 12:16 PM
Hi there,

I haven't done much windows programming for a few years.
However I have a suggestion that you might be able to follow up.

1) Get a handle to the the DOS screen window.
Use FindWindow or EnumWindows or something similar.

2) GetWindowRect will then give you the bounding dimensions
of the DOS screen and an associated Rectangle.

3) I assume there must be a function (or group of functions) to let you get the RGB values of all the points in this rectangle and form a bitmap.
From memory I think you use device contexts (DC) and functions like BitBlt.

Hope this bears some fruit.

Cheers,
Luke

Rabelo
March 27th, 2004, 12:57 PM
walllh

To do that, you donŽt need a TSR or a bitmap file. You just need a function to get the screen buffer and a while to get the mouse movement:
you can get the screen buffer copying the 4000 bytes from address B800:0000 an save it. This for text screen. For graphics screens youŽll neeed some more acurated routines to get and put the graphic screen buffer. I develop a routine to get the text buffer from a screen area, given the rectancle left superior and botom rigth corners. I used Turbo C3.0. Nowadays it is free and you can get it for free on net.
To get the mouse movement you can do a "while (true)" and get the mouse coordinates interruption (int 33 serv 3). This service will give you the actual mouse coordinates, and if the mouse movement need a attention you break the while or call a function inside the while trought an if.
I still have this routine, develop in assembler because there were a problem with flicker and was necessary get the electron beam retrace, only possible in assembler. About the mouse I develop a driver to get its actions like click, movements, cursors etc. and I can send them to you if you wish.

Regards

Rabelo