Thema: Delphi Icon pixelfrei

Einzelnen Beitrag anzeigen

Nils_13

Registriert seit: 15. Nov 2004
2.647 Beiträge
 
#8

Re: Icon pixelfrei

  Alt 2. Feb 2008, 12:28
Delphi-Quellcode:
function GetIcon(filename : String; IconIndex: Integer) : TBitmap;
var NumberOfIcons : Integer;
    Ico : TIcon;
begin
  NumberOfIcons := ExtractIcon(hInstance, PChar(Filename), UINT(-1));

  Ico := TIcon.Create;
  if (Ico <> nil) and (NumberOfIcons > -1) then
    Ico.Handle := ExtractIcon(hInstance, PChar(Filename), IconIndex);
  Result := TBitmap.Create;
  with Result do
  begin
    Width := Ico.Width;
    Height := Ico.Height;
    Canvas.Draw(0, 0, Ico);
  end;
  Ico.Free;
end;
So hole ich mir das Icon. Das Bild auf das ich es zuweise hat Transparent auf True.
  Mit Zitat antworten Zitat