Einzelnen Beitrag anzeigen

perle

Registriert seit: 8. Apr 2004
183 Beiträge
 
Delphi 7 Enterprise
 
#12

Re: Qualität eines Icon verbessern?

  Alt 11. Jan 2005, 15:24
icons von jpg dateien z.b. werden doch in der Registry definiert. Lies doch dort den pfad zum entsprechenden icon aus und kopier es dir.


EDIT : Genau das hab ich jetzt auch mal probiert und es funktioniert im Grunde auch, allerdings habe ich dann ebenfalls eine recht miese Qualität der Icons

Delphi-Quellcode:
uses ShellApi, RegWork, LibDirectoryU, StrUtils;

procedure TForm1.FormCreate(Sender: TObject);
var
  big_icon, small_icon : HIcon;
  IconS : String;
begin
  IconS := rw.GetFileIconString('jpg');
  if pos('dll',IconS) > 0 then
   begin
     // wenn das Icon aus einer
     // dll geladen werden muss
     ExtractIconEx(PChar(copy(IconS,
                   0,
                   pos(',',IconS) - 1)),
                   StrToInt(RightStr(IconS,Length(IconS) - pos(',',IconS))),
                   big_icon,
                   small_icon,
                   1);
     with TIcon.Create do
     begin
       Handle := big_icon;
       SaveToFile(Applicationdir + 'big_icon.ico');
       Handle := small_icon;
       SaveToFile(Applicationdir + 'small_icon.ico');
     end;
   end;
end;
  Mit Zitat antworten Zitat