Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: Grafik / Sound / Multimedia (https://www.delphipraxis.net/21-library-grafik-sound-multimedia/)
-   -   Delphi Icon in TBitmap umwandeln (https://www.delphipraxis.net/302-icon-tbitmap-umwandeln.html)

thomasdrewermann 30. Jun 2002 12:46


Icon in TBitmap umwandeln
 
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]


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:51 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz