Comandant.
Cita:
Empezado por Comandant
como hago para obtener el stream de la ImageList1 y escribirlo o cargarlo en la ImageList2
|
Revisa este link:
Revisa este código:
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, StdCtrls, Buttons, ToolWin, ComCtrls;
type
TForm1 = class(TForm)
ImageList1: TImageList;
Button1: TButton;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
ImageList2 : TImageList;
begin
ImageList2 := TImageList.Create(nil);
try
WriteComponentResFile('ImageList.dat', ImageList1);
ReadComponentResFile('ImageList.dat', ImageList2);
except
ImageList2.Free;
MessageDlg('Error al Procesar el Archivo ImageList.Dat', mtinformation, [mbok], 0);
exit;
end;
Toolbar1.Images := ImageList2;
Toolbar1.Buttons[0].ImageIndex := 0;
Toolbar1.Buttons[1].ImageIndex := 1;
Toolbar1.Buttons[2].ImageIndex := 2;
end;
end.
El código anterior copia todas las imágenes de un TImageList a otro TImageList y asigna estas a un TToolbar.
Espero sea útil
Nelson.