Einzelnen Beitrag anzeigen

jbg

Registriert seit: 12. Jun 2002
3.481 Beiträge
 
Delphi 10.1 Berlin Professional
 
#2
  Alt 17. Okt 2002, 22:01
Das geht nur etwas umständlich:
Code:
[b]function[/b] CreateBitmapFromIcon(Icon: TIcon): TBitmap;
[b]begin[/b]
  Result := TBitmap.Create;
  [b]try[/b]
    Result.Width := Icon.Width;
    Result.Height := Icon.Height;
    Result.Canvas.Draw(0, 0, Icon);
  [b]except[/b]
    Result.Free;
    [b]raise[/b];
  [b]end[/b];
[b]end[/b];


bmp := CreateBitmapFromIcon(Application.Icon);
[b]try[/b]
  SpeedBtn.Glyph.Assign(bmp);
[b]finally[/b]
  bmp.Free;
[b]end[/b];
  Mit Zitat antworten Zitat