A
Another_eYes
Unregistered / Unconfirmed
GUEST, unregistred user!
没啥可说的,看代码就明白了:
unit ZippedImgLst;
interface
uses
SysUtils, Classes, Controls, zlib;
type
TZippedImageList = class(TImageList)
protected
procedure ReadData(Stream: TStream); override;
procedure WriteData(Stream: TStream); override;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Additional', [TZippedImageList]);
end;
procedure TZippedImageList.ReadData(Stream: TStream);
var
stm: TDecompressionStream;
begin
stm := TDecompressionStream.Create(Stream);
inherited ReadData(stm);
stm.Free;
end;
procedure TZippedImageList.WriteData(Stream: TStream);
var
stm: TCompressionStream;
begin
stm := TCompressionStream.Create(clMax, Stream);
inherited WriteData(stm);
stm.Free;
end;
end.
unit ZippedImgLst;
interface
uses
SysUtils, Classes, Controls, zlib;
type
TZippedImageList = class(TImageList)
protected
procedure ReadData(Stream: TStream); override;
procedure WriteData(Stream: TStream); override;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Additional', [TZippedImageList]);
end;
procedure TZippedImageList.ReadData(Stream: TStream);
var
stm: TDecompressionStream;
begin
stm := TDecompressionStream.Create(Stream);
inherited ReadData(stm);
stm.Free;
end;
procedure TZippedImageList.WriteData(Stream: TStream);
var
stm: TCompressionStream;
begin
stm := TCompressionStream.Create(clMax, Stream);
inherited WriteData(stm);
stm.Free;
end;
end.