Xref: utzoo comp.graphics:7621 comp.lang.pascal:2359
Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!uwm.edu!csd4.csd.uwm.edu!jrn
From: jrn@csd4.csd.uwm.edu (James Ray Norton)
Newsgroups: comp.graphics,comp.lang.pascal
Subject: VGA Graphics
Message-ID: <216@uwm.edu>
Date: 25 Sep 89 17:15:28 GMT
Sender: news@uwm.edu
Reply-To: jrn@csd4.csd.uwm.edu (James Ray Norton)
Followup-To: comp.graphics
Organization: University of Wisconsin-Milwaukee
Lines: 73


Hi,

I have a slight problem....

I am trying to write a program using Turbo Pascal Version 5.  This program is
supposed to save a graphics image (VGA 640 x 480) to the disk and later reload
the image back to the display...

I have written a routine that will save the image (tested it by putting the
image back on the screen)...However my routine to load the image file to
the screen will not work...

THe source code for my routines are as follows...


procedure  SaveGraph(GraphicFile:  string; x,y,xw,yw: real; xres,yres: integer;
                     var IOR:  integer);

var  ImageChunk:  pointer;
     DiskFile:  File;
     Junk:  word;
     InfoFile:  Text;

begin
 Assign(DiskFile, GraphicFile);
   .
   .
   .
 Rewrite(DiskFile, 65533);
 GetMem(ImageChunk, 65533);
 GetImage(0,0,480,480, ImageChunk^);
 BlockWrite(DiskFile, ImageChunk^,1);
 FreeMem(ImageChunk, 65533);
 Close(DiskFile);
end;

The above routine is working....

Now for the routine that does not work..

procedure  LoadGraph(GraphicFile:  string;
                     var  x,y,xw,yw: real;
                     var  PixX,PixY,Size:  integer;
                     var  IOR:  integer);

Var  DiskFile:  File;
     InfoFile:  Text;
     DataBuffer:  Pointer;

Begin
 Assign(DiskFile, GraphicFile);
   .
   .
   .
   .
 Reset(DiskFile, 65533);
 GetMem(DataBuffer, 65533);
 BlockRead(DiskFile, DataBuffer^,1);
 PutImage(0,0,DataBuffer^,0);
end;

This procedure causes no errors....But it just causes the screen to go blank..

I would greatly appreciate any help that could be given....

thanks in advance..

--
_______________________________________________________________________________
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 _    _ _       _ _ _
' )  / ' )   / ' ) ) )                                  jrn@csd4.csd.uwm.edu