home *** CD-ROM | disk | FTP | other *** search
-
- (* *************************************************************** *)
- (* *)
- (* SAVESCRN.LIB *)
- (* *)
- (* If you $I include these procedures in your program you will *)
- (* be able to save screens to disk in a format you can use for *)
- (* your Turbo Pascal programs. You can use the LoadScreen pro- *)
- (* cedure to load a screen saved by SaveScreen. By passing an *)
- (* offset of 73, it is possible to load a PC Paint Screen that *)
- (* has been saved in the uncompressed format (16 kbytes). The *)
- (* files produced here contain no header information so all the *)
- (* screen parameters must be set in advance. Usually this means *)
- (* something like the following : *)
- (* *)
- (* GraphColorMode; GraphBackGround (0); Palette (0); *)
- (* LoadScreen ('FILENAME.XXX',0); *)
- (* *)
- (* Try out the program Savescrn.Com which will allow you to *)
- (* set the various parameters. If you have PC Paint try it with *)
- (* the sample pictures on the disk. Vary the offset to see what *)
- (* happens to the pictures. The program Savescrn.Com will load *)
- (* a PC Paint program, strip its header, and write it to disk *)
- (* in Turbo Pascal format. Haven't you always wanted to use a *)
- (* a paint program to generate fancy screens for your Turbo *)
- (* programs? *)
- (* *)
- (* Donald L. Pavia *)
- (* Department of Chemistry *)
- (* February 1986 Western Washington University *)
- (* Bellingham, Washington 98225 *)
- (* *)
- (* *************************************************************** *)
-
-
- type { Str14 = String[14]; } { must be included in main program }
- ScreenPointer = ^ScreenType;
- ScreenType = array[0..16383] of byte;
- ScreenFile = file of ScreenType;
-
- var Screen : ScreenPointer;
-
- {-------------------------------------------------------}
- procedure SaveScreen (FileName : str14);
-
- var FileToSave : ScreenFile;
-
- begin
- Screen := ptr ($B800,$0000);
- assign (FileToSave,FileName);
- rewrite (FileToSave);
- write (FileToSave,Screen^);
- close (FileToSave);
- end;
- {-------------------------------------------------------}
- procedure LoadScreen (FileName : str14; Offset : byte);
-
- var DisplayFile : ScreenFile; { normally, the offset }
- { will be zero }
- begin
- Screen := ptr ($B800,Offset);
- assign (DisplayFile,FileName);
- reset (DisplayFile);
- read (DisplayFile,Screen^);
- close (DisplayFile);
- end;
- {------------------------------------------------}
-