Ver Mensaje Individual
  #3  
Antiguo 22-11-2012
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
Comandant.

Cita:
Empezado por Comandant Ver Mensaje
como hago para obtener el stream de la ImageList1 y escribirlo o cargarlo en la ImageList2
Revisa este link:
Cita:
Save (and Load) all the Images from a TImageList to a Single File : http://delphi.about.com/od/delphitip...ecomponent.htm
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
    { Private declarations }
  public
    { Public declarations }
  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.

Última edición por nlsgarcia fecha: 22-11-2012 a las 22:19:22.
Responder Con Cita