Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing contents of screen in C?

0 views
Skip to first unread message

Phil ~Phlash~ Ashby

unread,
Sep 1, 1995, 3:00:00 AM9/1/95
to
w...@wolfe.net (William White) wrote:
> Could someone please tell me how I would go about sending the contents of
>the screen to the printer?

If you only want basic screen dump support, then invoke the BIOS print screen
routine which will do it all for you, INT 5h (or ask the user to press the
PrintScn key :).

--
!------- p...@mround.bt.co.uk -------! GAT d?(d) H s:-- g?>+++ p?>! au--- a- w+
!Phil "Phlash" Ashby!+44-1473-642735! v*>! C++$ L+>+++ 3+ ULHS+++(++++)$ P- E-
!MLB G/35,BT Labs,Martlesham,England! N++ K- W++ M V->! -po+ Y+ t-@ 5+ !j R G?
!- http://www.mround.bt.co.uk/~paa -! tv>! b+ D+ B? e-- u+(-) h---- f* r+++ y*


William White

unread,
Sep 1, 1995, 3:00:00 AM9/1/95
to
Could someone please tell me how I would go about sending the contents of
the screen to the printer?

---Will
+----------------------------------------------------------------------+
| William White ŽŻ Yakima, WA. ŽŻ Hi-Country Foods Corporation |
| Quality Assurance Lab Technician ŽŻ Computer Analyst/Programmer |
| ** We make it, you drink it, you love it ** |
|Check out our new web page at http://www.wolfe.net/~hcfoods/index.html|
| For my Public PGP key, please finger me at w...@wolfe.net |
+----------------------------------------------------------------------+


gcli...@ulkyvx.louisville.edu

unread,
Sep 1, 1995, 3:00:00 AM9/1/95
to
In article <426b6e$p...@ratty.wolfe.net>, w...@wolfe.net (William White) writes:
> Could someone please tell me how I would go about sending the contents of
> the screen to the printer?
>
> ---Will
> +----------------------------------------------------------------------+
> | William White ŽŻ Yakima, WA. ŽŻ Hi-Country Foods Corporation |

Seem> | Quality Assurance Lab Technician ŽŻ Computer Analyst/Programmer |

> | ** We make it, you drink it, you love it ** |

> |CSheck out our new web page at http://www.wolfe.net/~hcfoods/index.html|


> | For my Public PGP key, please finger me at w...@wolfe.net |

> +--Ss--------------------------------------------------------------------+
> s
s

Seems like I recall int 5 can be used for this. Sorry for the
way the reply looks, your message gave my newsreader fits.

David

Isaac Foraker

unread,
Sep 1, 1995, 3:00:00 AM9/1/95
to
William White (w...@wolfe.net) wrote:
: Could someone please tell me how I would go about sending the contents of
: the screen to the printer?

Easiest way I've done it is to open the printer as a file, PRN.
Then just write to the printer like you would a file.

--

===== zar...@bradley.edu ===== http://rhf.bradley.edu/~zarkon/ =====
Recursive: adj. see Recursive

Alexander J. Russell

unread,
Sep 1, 1995, 3:00:00 AM9/1/95
to
> Could someone please tell me how I would go about sending the contents of
>the screen to the printer?
>
> ---Will
>+----------------------------------------------------------------------+
>| William White ŽŻ Yakima, WA. ŽŻ Hi-Country Foods Corporation |
>| Quality Assurance Lab Technician ŽŻ Computer Analyst/Programmer |
>| ** We make it, you drink it, you love it ** |
>|Check out our new web page at http://www.wolfe.net/~hcfoods/index.html|

>| For my Public PGP key, please finger me at w...@wolfe.net |
>+----------------------------------------------------------------------+
>
>
The text screen is at segment B800. It is orginaized in character/attribute
pairs.

So
char far *screen;
int i;

screen=MK_FP(0xb800,0);
for (i=0; i < (80*25); i++, screen+=2)
print_char(*screen);

print_char() is some function to print a char, put in new lines at the right
time etc...
The AnArChIsT - Anarchy! NOT Chaos! aka Alec Russell
ale...@icebox.iceonline.com

Warren Porter

unread,
Sep 6, 1995, 3:00:00 AM9/6/95
to
09/05/95 07:45 pm

WWłFrom: w...@wolfe.net (William White)
WWłSubject: Printing contents of screen in C?
WWł
WWł Could someone please tell me how I would go about sending
WWłthe contents of the screen to the printer?

Assuming you are in ordinary text mode, video memory is likely to
start in

{
char far *ptr;
ptr = (char far *) 0xb8000000L ; ... }

Each character will be followed by its attribute byte, so you will
have to ptr += 2 after moving *ptr to its position in a print
buffer. HTH
---
ţ SPEED 1.40 #1672 ţ "Gullible" isn't in the dictionary. Oh, really?

0 new messages