?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. Program Scr;
  2. uses Crt,Graph;
  3. const
  4.   TIFprefix : string =
  5.     #73#73#42#0#8#0#0#0#15#0#254#0#4#0#1#0#0#0#0#0#0#0#0#1#4#0
  6.    +#1#0#0#0#0#1#0#0#1#1#4#0#1#0#0#0#192#0#0#0#2#1#3#0#1#0#0#0
  7.    +#1#0#0#0#3#1#3#0#1#0#0#0#1#0#0#0#6#1#3#0#1#0#0#0#1#0#0#0#17
  8.    +#1#4#0#1#0#0#0#194#0#0#0#21#1#3#0#1#0#0#0#1#0#0#0#22#1#4#0
  9.    +#1#0#0#0#192#0#0#0#23#1#4#0#1#0#0#0#0#24#0#0#26#1#5#0#1#0#0
  10.    +#0#194#24#0#0#27#1#5#0#1#0#0#0#202#24#0#0#28#1#3#0#1#0#0#0
  11.    +#1#0#0#0#40#1#3#0#1#0#0#0#2#0#0#0#61#1#3#0#1#0#0#0#1#0#0#0
  12.    +#0#0#0#0;
  13.   TIFpostfix : string =
  14.     #80#0#0#0#1#0#0#0#80#0#0#0#1#0#0#0;
  15. var
  16.  TF,ZF:File of Char;
  17.  name,name1,name2:string;
  18.  b:array [0..191,0..31] of byte;
  19.  c:char;
  20.  n:Longint;
  21.  gr,modd,i,j,k,m:integer;
  22.  
  23. begin
  24.   ClrScr;
  25.   n:=0;
  26.   Writeln('Конвертация экранного файла');
  27.   Writeln('формата SCR');
  28.   Writeln('в графический TIFF-файл');
  29.   Writeln('(Black & White  256x192).');
  30.   Write('Имя  SCR-файла : ');Readln(name);
  31.   name1:=Name+'.scr';
  32.   name2:='d:\'#39'slava'#39'\images\'+Name+'.tif';
  33.   gr:=detect;
  34.   InitGraph(gr,modd,'d:\tp7\bgi\');
  35.  
  36.   Assign(ZF,name1);
  37.   Reset(ZF);
  38.  
  39. {  for i:=1 to 17 do read(ZF,c);            {read TR DOS prefix}
  40.  
  41.   for m:=0 to 2 do                       {read TR DOS screen}
  42.     for k:=0 to 7 do
  43.       for j:=0 to 7 do
  44.         for i:=0 to 31 do
  45.           begin
  46.             read(ZF,c);
  47.             b[m*64+j*8+k,i]:=ord(c);
  48.             for gr:=0 to 7 do
  49.              putpixel(i*8+gr,m*64+j*8+k,(ord(c) shr (7-gr) and 1 xor 1)*14);
  50.           end;
  51.  
  52.   Close(ZF);
  53.  
  54.   Assign(TF,name2);
  55.   Rewrite(TF);
  56.  
  57.   for i:=1 to 194 do write(TF,TIFprefix[i]);  {save TIFF prefix}
  58.  
  59.   for i:=0 to 191 do                          {save  TIFF screen}
  60.      for j:=0 to 31 do
  61.        begin
  62.          c:=chr (not b[i,j]);
  63.          write(TF,c);
  64.        end;
  65.  
  66.   for i:=1 to 16 do write(TF,TIFpostfix[i]);  {save TIFF postfix}
  67.  
  68.   Close(TF);
  69.  
  70.   repeat until KeyPressed;
  71.   CloseGraph;
  72.  
  73. end.