首页  编辑  

如何保存ImageList里面的内容

Tags: /超级猛料/Picture.图形图像编程/控件和绘图/   Date Created:

:hubdog, 时间:2001-4-30 14:03:55, ID:519919  

//write imagelist

procedure TForm1.Button1Click(Sender: TObject);

var FS : TFileStream;

begin

 FS := TFileStream.Create('C:\save.Dat',fmCreate);

 FS.WriteComponent(imagelist1);

 FS.Free;

end;

//Read imagelist

procedure TForm1.Button2Click(Sender: TObject);

var FS : TFileStream;

begin

 RegisterClass(TImageList);

 FS := TFileStream.Create('C:\save.Dat',fmOpenRead);

 TComponent(imagelist1) := FS.ReadComponent(imagelist1);

 FS.Free;

end;