Path: utzoo!attcan!utgpu!watmath!maytag!watstat!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: comp.lang.pascal Subject: Re: Saving screen images to disk, can you help? Message-ID: <397@maytag.waterloo.edu> Date: 21 Aug 89 13:09:06 GMT References: <5425@decvax.dec.com> <4487@druhi.ATT.COM> Sender: daemon@maytag.waterloo.edu Reply-To: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Organization: U. of Waterloo, Ontario Lines: 28 In article <4487@druhi.ATT.COM> boc@druhi.ATT.COM (Ocinneide) writes: >In article <5425@decvax.dec.com>, f0057@uafhp.uucp (James E. Ward) writes: >> >> >> A few days ago, I posted a brief request for help in this newsgroup. I guess >> it was too brief! What I need is techniques for saving screen images to disk >> files using Turbo Pascal 5.0! I am doing a bit of graphics/animation and need >> to be able to save part of or all of the screen to disk. Let me know if you >> can help, okay? >> >> James E. Ward >> f0057@uafhp.uucp Use this address or be bounced! > >The Graphic Screen Ram on a PC or Compatible starts at segment $B800. Once your image is being displayed on the screen you need to copy the appropriate memory segments to your file. I believe for CGA 4-Color Graphics mode you need to copy 16K bytes start i >ng at this segment. Something like this should do it... It's much safer to use Getimage and Putimage from the Graph unit. They'll work on any display that you have a BGI driver for, and can save any rectangular region on the screen. (Well, almost any. There was a bug that made them ignore requests to save/restore a single line of pixels, but it may have been fixed in 5.0 or 5.5.) Be sure to use ImageSize to work out how much space is needed; you can't just multiply rows by columns by depth and get the right number. To save to a file, just use BlockWrite after Getimage. Duncan Murdoch