Procedure AddToStream ( Source , Dest : TStream );
var
Size: Integer;
begin
Source.position := 0;
Size := Source.Size;
Dest.Write(Size,SizeOf(Integer));
Dest.CopyFrom(Source,Source.size);
end;
procedure TForm1.SaveClick(Sender: TObject);
var
s1, s2: TMemoryStream ;
i: integer;
begin
s1:= TMemoryStream.Create ;
try
s2:= TMemoryStream.Create ;
try
for i:=1 to 300 do
begin
s2.LoadFromFile('C:\Image\'+IntToStr(i)+'.jpg');
AddToStream(s2,s1);
end;
finally
s2.Free ;
end;
s1.SaveToFile('C:\Image.dat')
finally
s1.free ;
end;
end;
чтение image из файла |