Einzelnen Beitrag anzeigen

Niko

Registriert seit: 23. Jun 2003
416 Beiträge
 
Delphi 2006 Professional
 
#4

Re: Icon aus Resource in eine Imagelist?

  Alt 23. Aug 2004, 17:06
Hm, komisch.

Aber wenn's mit den Borland-Funktionen nicht geht, dann eben ganz altmodisch über die Win-API :
Delphi-Quellcode:
var
  Hd: THandle;
  Ico: TIcon;

//...

Hd := LoadImage(HInstance, 'MAINICON', IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
Ico := TIcon.Create;
try
  Ico.ReleaseHandle;
  Ico.Handle := Hd;
  ImageList1.AddIcon(Ico);
finally
   Ico.Free;
end;
"Electricity is actually made up of extremely tiny particles called electrons, that you cannot see with the naked eye unless you have been drinking." (Dave Barry)
  Mit Zitat antworten Zitat