Autor Beitrag
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Di 28.01.03 21:02 
Hallo,

ich habe ein paar fragen:
  1. Wie kann ich icon aus DLLS und EXE dateien laden von delphi aus ?
  2. Wie kann ich eine icon liste in form von einer DLL erstellen? (also ich möchte einfach alle icos in einer DLL packen vom Pgramm aus also nicht von delphi aus)
  3. Wie kann ich ICON dateien icon dateien wandel: icon <> BMP, iocn<>JPEG,ICOM<> GIF

ich hoffe ihr habt meine drei Fragen verstanden. Bitte gleich mit beispielen antworten.

_________________
MFG
Michael Springwald, "kann kein englisch...."


Zuletzt bearbeitet von mimi am Mi 29.01.03 16:04, insgesamt 1-mal bearbeitet
LarsMiddendorf
Hält's aus hier
Beiträge: 11



BeitragVerfasst: Di 28.01.03 23:33 
Mit der Funktion Extracticon aus der unit shellapi kann man Icons aus Dateien auslesen.
ausblenden Quelltext
1:
ExtractIcon(hinstance,Dateiname,IconNummer)					

Die Funktion gibt ein Handle zurück, das einem TIcon Objekt zugewiesen werden kann.
ausblenden Quelltext
1:
2:
3:
4:
5:
icon:TIcon;
...
icon:=TIcon.create

icon.handle:=ExtractIcon(hinstance,Dateiname,IconNummer);


Moderiert von user profile iconTino: Code-Tags hinzugefügt.
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 29.01.03 00:05 
Danke werde ich morgen mal testen :P

_________________
MFG
Michael Springwald, "kann kein englisch...."
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 29.01.03 15:25 
Wie bekomme ich denn ICON count heraus ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 29.01.03 15:28 
Hallo,

mit -1 als letzter Parameter für ExtractIcon.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
var
  AnzIcons:Integer;

  ...
  AnzIcons:=ExtractIcon(hinstance, 'Delphi32.exe', -1);
  ...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 29.01.03 16:01 
so einfach !
danke werde ich mal teten ob ich es umsetzen kann;)

und wie kann ich die andren 2 Fragen hinbekommen ?

_________________
MFG
Michael Springwald, "kann kein englisch...."
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mi 29.01.03 16:12 
Hallo mimi,

zu 3.)

Nachfolgend ein Beispiel wie ein Icon in eine Bitmap gewandelt wird. Für die anderen Typen funktioniert es im Prinzip analog dazu.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
var
  aIcon:TIcon;
  aBmp:TBitmap;

  ...
  aIcon:=TIcon.Create;
  aBmp:=TBitmap.Create;

  aIcon.LoadFromFile('MeinIcon.ico');
  with aBmp do
  begin
    Width:=aIcon.Width;
    Height:=aIcon.Height;
    Canvas.Draw(0, 0, aIcon);
    SaveToFile('MeinIconAlsBmp.bmp');
  end; // with aBmp

  aBmp.Free;
  aIcon.Free;
  ...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
mimi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Mi 29.01.03 17:24 
Vielen danke werde ich mal testen....

_________________
MFG
Michael Springwald, "kann kein englisch...."