home *** CD-ROM | disk | FTP | other *** search
/ GRIPS 2: Government Rast…rocessing Software & Data / GRIPS_2.cdr / dos / adrg / source / dispany.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-09-06  |  1.0 KB  |  39 lines

  1. program dispany;     { display any ADRG file generated with }
  2.                      { the adrgrgb or adrgtpc programs }
  3. uses Crt,Graph;
  4.  
  5. const r = 349;   {349 maximum for EGA}
  6.       c = 639;   {639 maximum for EGA}
  7. var
  8.   fael : file;
  9.   user_file : string;
  10.   ro,col, grdrv,grmod : integer;
  11.   ch : char;
  12.   buf : array[0..639] of byte;  {change the limit if the value of c is changed}
  13.   wrtcnt : word;
  14.   temp : byte;
  15.  
  16. begin                  {** dispany **}
  17.   checkbreak := true;
  18.   grdrv := EGA;grmod := EGAHi;   {change accordingly if other than EGA}
  19.  
  20.  { Prompt user for input file name }
  21.   writeln;writeln;
  22.   write('           Enter name of file to be displayed: ');
  23.   readln(user_file);
  24.  
  25.   assign(fael,user_file);reset(fael,1);
  26.   InitGraph(grdrv,grmod,'');
  27.  
  28.        for ro := 0 to r do
  29.        begin
  30.          blockread(fael,buf,sizeof(buf),wrtcnt);
  31.          for col := 0 to c do
  32.             putpixel(col, ro , buf[col]);
  33.        end;  {** for ro **}
  34.  
  35.   close(fael);
  36.  
  37.   ch := ReadKey;
  38.   CloseGraph;
  39. end.   {** dispany **}