jrn@csd4.csd.uwm.edu (James Ray Norton) (09/26/89)
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
tris@alzabo.uucp (Tris Orendorff) (09/27/89)
jrn@csd4.csd.uwm.edu (James Ray Norton) writes: >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 VGA video buffer in VGA 640 x 480 is arranged as four bitplanes. You will have to read the video buffer four times, taking one plane at a time. I suggest that you get the following book: Programmer's Guide to PC and PS/2 Video Systems Richard Wilton Microsoft Press ISBN 1-55615-103-9 Another alternative is to use a screen capture program to save your image in one of the normal formats (PCX, PIC, LBM, GIF). -- Sincerely Yours Tris Orendorff .......................................................................