![]() |
Bitmap zu Icon ohne Farbe Verlust ?
hallo
ich habe mehrere Funktionen getestet um ein Bitmap in Icon zu konvertieren das Problem ist nach dem Konvertieren bekomme ich eine ein Icon mit schlechter Qualität Beispiel mit dieser Funktion : ![]() Ich suche eine Funktion, die ein gutes Icon erstellt ohne oder mit weniger Farben Verlust aber auch soll ein valid Icon erstellen |
Re: Bitmap zu Icon ohne Farbe Verlust ?
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo,
So wird die Qualität besser:
Delphi-Quellcode:
// Beispiel:
uses
IconsToFile; {Siehe Anhang icon2file.zip} function Bmp2Ico(Bitmap: TBitmap; IcoFileName: TFilename): Boolean; var Icon: TIcon; ImageList: TImageList; begin Result := False; ImageList := TImageList.CreateSize(Bitmap.Width, Bitmap.Height); try ImageList.AllocBy := 1; ImageList.AddMasked(Bitmap, Bitmap.TransparentColor); Icon := TIcon.Create; try ImageList.GetIcon(0, Icon); Result := hicontofile(IcoFileName, Icon.Handle, BitC24) <> -1; // Icon.SaveToFile(IcoFileName); finally Icon.Free; end; finally ImageList.Free; end; end;
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin Bmp2Ico(Image1.Picture.Bitmap, 'c:\Output.ico'); end; |
Re: Bitmap zu Icon ohne Farbe Verlust ?
Ich habe auch die Hilfe im Anhang gelesen : )
jetzt weiß ich warum mein icon nach dem Speichern schlecht wird :thumb: Danke |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz