Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!know!samsung!ernie.viewlogic.com!m2c!umvlsi!dime!aspasia!eli From: eli@aspasia.gang.umass.edu (Eli Brandt) Newsgroups: comp.lang.pascal Subject: Re: Graphic-screen to disk Message-ID: <22706@dime.cs.umass.edu> Date: 16 Nov 90 17:53:39 GMT References: <25017@adm.brl.mil> Sender: news@dime.cs.umass.edu Reply-To: eli@aspasia.CS.UMASS.EDU (Eli Brandt) Organization: University of Massachusetts, Amherst Lines: 38 In article <25017@adm.brl.mil> S89405079%HSEPM1.HSE.NL@uga.cc.uga.edu writes: >Hi, > >I have a little problem dumping the graphics-screen to disk. The problem is >that when I dump such a screen, all the colors disappear. Does anyone >know what I'm doing wrong? > >Edwin Groothuis >S89405079@hsepm1.hse.nl > >============================ PROGRAM ========================== >uses crt,dos,graph; >type screen_type:array[0..$FFFF] of byte; >var fil:file of screen_type; > screen:^screen_type; > driver,mode:integer; > i:integer; > >begin > detectgraph(driver,mode); > initgraph(driver,mode,''); > for i:=1 to 100 do > circle(100,100,i); (* Make something on the screen *) > screen:=ptr($A000,0000) > assign(fil,'test');rewrite(fil);write(fil,screen);close(fil); > clearviewport; > assign(fil,'test');reset(fil);read(fil,screen);close(fil); >end. Well, if you're getting anything, you're presumably in EGA/VGA mode. These modes store the frame buffer as 4 bitplanes, all mapped to the A000 segment. What you get when you read/write depends on the status of the select and mask registers. The simplest way to get a screen dump would probably be to pull each of the four bitplanes in turn, and put them back the same way. If you don't have a reference for the registers, e-mail me and I'l get back to you after I've looked it up. :-) Eli