Einzelnen Beitrag anzeigen

Benutzerbild von thomasdrewermann
thomasdrewermann

Registriert seit: 8. Jun 2002
Ort: Herne
575 Beiträge
 
Delphi 3 Professional
 
#1

Icon in TBitmap umwandeln

  Alt 30. Jun 2002, 12:46
Hier die Lösung, man Gibt den Pfad eines Icons an und bekommt ein TBitmap zurück:

Delphi-Quellcode:
function icotobmp(filename: string): tbitmap;
var
  Icon: TIcon;
begin
  Icon := TIcon.Create;
  result := TBitmap.create;
  try
    Icon.LoadFromFile(filename);
    result.Width := Icon.Width;
    result.Height := Icon.Height;
    result.Canvas.Draw(0, 0, Icon);
  finally
    Icon.Free;
  end;
end;
[edit=flomei] Mfg, flomei[/edit]
Sport ist mord...
  Mit Zitat antworten Zitat