Uses Graph; const count = 60; { table :array [0..15] of byte = (0,1,2,3,4,5,6,7,8,9,Brown,11,Blue,13,14,15);} Procedure EGAVGADriver;external; var inp,outp : file; p : pointer; Name : string; Beg : string; Size : word; k,i,j : word; x,y : word; val : byte; gD,gM : Integer; begin gD:=Detect; {$L EGAVGA.OBJ} RegisterBGIDriver(@EGAVGADriver); InitGraph(gD,gM,''); Assign(outp,'stinger.dat'); ReWrite(outp,1); k:=count; BlockWrite(OUTP,k,2); Beg := 'Stingers\stng'; for k := 0 to count-1 do begin Str(k,Name); Name := Beg + Name + '.tga'; OutTextXY(300,200,Name); Assign(inp,Name); Reset(inp,1); Seek(INP,12); BlockRead(inp,x,2); BlockRead(inp,y,2); Seek(Inp,$312); for i := 1 to y do for j := 1 to x do begin BlockRead(INP,val,1); if (val and $F) <> $F then PutPixel(j,y-i+1, 0) else PutPixel(j,y-i+1,White); end; Close(INP); Size := ImageSize(0,0,x,y); BlockWrite(OUTP,Size,2); GetMem(P,Size); GetImage(1,1,x,y,P^); BlockWrite(OUTP,P^,Size); FreeMem(P,Size); ReadLn; ClearDevice; end; CloseGraph; Close(OUTP); end.