不明白你的意思!我要的是反映压缩的过程。还是把代码列出来:
//压缩过程
procedure TMainForm.FileCompress(const CompFileName: String; var dstStream: TMemoryStream; const CompressionLevel: TCompressionLevel);
var
msY : TMemoryStream;
zComp:TCompressionStream;
Count:Integer;
begin
msY:=TMemoryStream.Create;
zComp:=TCompressionStream.Create(CompressionLevel, DstStream);
zComp.OnProgress :=MyActive;
try
msY.LoadFromFile(CompFileName);
Count:=msY.Size;
//存入文件的原始大小
DataModule1.Table1.findField('Bytes').value:=Count;
msY.SaveToStream(zComp); //压缩文件到dststream中
finally
msY.Free;
zComp.Free;
end;
end;
//MyActive
procedure TMainForm.MyActive(Sender: TObject);
begin
if Sender is TCompressionStream then
begin
with Sender as TCompressionStream do begin
ProgressBarForm.ProgressBar1.Max :=Size;
ProgressBarForm.ProgressBar1.Position :=Position;
end;
end;
end;
编译时能通过!