Autor Beitrag
finn91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 18


Delphi 7
BeitragVerfasst: Sa 30.06.07 20:21 
Hallo.

Der denke, der Titel sagt schon alles :wink:. Ich suche einen Button, der in der Lage ist, Icons mit Alpha Channel (32-Bit) darzustellen.

Schöne Grüße,

Finn
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Sa 30.06.07 22:25 
mit PNG-Image wird ne kompo mitgeliefert! PNG-Button!

lg elundril
finn91 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 18


Delphi 7
BeitragVerfasst: So 01.07.07 11:56 
Danke erstmal für die Antwort :). Leider bekomm ich es nicht hin, dem Button eine Icon-Datei zuzuweisen.

Gruß,

Finn
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: So 01.07.07 13:22 
da musst du dann statt *.ico eine *.png datei nehmen!

lg elundril
finn91 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 18


Delphi 7
BeitragVerfasst: So 01.07.07 13:29 
Das geht leider nicht. Ich erkläre einfach mal, weshalb ich einen solchen Button brauche.

Ich ermittel zur Laufzeit das Icon von einer Datei (die Datei ist immer verschieden). Dieses Icon ist mit Alpha Channel. Dann extrahiere ich das Icon aus der Datei und dieses Icon will ich dann auf einem Button darstellen (natürlich mit dem Alpha Channel, also z. B. dem Schatten bei den XP-Icons).

Schöne Grüße

Finn
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: So 01.07.07 13:36 
aso! muss es wirklich ein button sein?

Icon32 is zwar kein button aber man kanns ja mit nem OnClick ereignis zu einem machen.

Icon32

lg elundril
finn91 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 18


Delphi 7
BeitragVerfasst: So 01.07.07 14:06 
Leider muss es ein Button sein und er muss einen (dünnen, also möglichst im Flat-Stil) Rahmen haben.

Zur Not würde ich natürlich auch Umwege in Kauf nehmen. Allerdings wüsste ich nicht welche bzw. wie man die dann realisieren könnte, da ich ein absoluter Neuling bin.

Ich bin für jede Hilfe dankbar.

Schöne Grüße,

Finn
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: So 01.07.07 16:35 
Moin finn,

ich weiß nicht genau, ob es das Richtige ist aber mit ein paar Tricks gehts auch so (evtl. anpassungsbedürftig):

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
var
  Form1: TForm1;
  img: TImage;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var hIcon: THandle;
    AppName: String;
begin
 AppName := ExtractFilename(PARAMSTR(0)); // z.b. 'C:\Windows\System32\mspaint.exe';
 hIcon := ExtractIcon(hInstance, PChar(AppName), 0);
 with img do begin
  parent  := Button1;
  name    := 'img';
  width   := 32;
  height  := 32;
  top     := (Button1.Height div 2) - (img.Height div 2);
  left    := (Button1.Width div 2) - (img.Width div 2);
  img.Picture.Icon.Handle := hIcon;
  end;
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
 img := TImage.Create(Button1);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
 img.Free;
end;

end.


Gruß
Smikey
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 45

Win XP, kUbuntu 6.06
Delphi 2005 Architect
BeitragVerfasst: So 01.07.07 17:42 
warum wandelst du dein icon nicht fix in eine png fuer den png-button um?

mfg smikey

_________________
Bloß weil du nicht paranoid bist, heißt das nicht, dass sie nicht hinter dir her sind.
finn91 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 18


Delphi 7
BeitragVerfasst: So 01.07.07 17:47 
Und wie würde das gehen? Tut mir Leid wenn ich so direkt frage, aber danach hatte ich auch schon gesucht aber nichts passendes gefunden.

Gruß,

Finn
Smikey
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 45

Win XP, kUbuntu 6.06
Delphi 2005 Architect
BeitragVerfasst: So 01.07.07 17:54 
oops... ich hab mal nachgeschaut aber keine einfache möglichkeit gefunden.. sry.. ;)

mfg smikey

_________________
Bloß weil du nicht paranoid bist, heißt das nicht, dass sie nicht hinter dir her sind.
finn91 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 18


Delphi 7
BeitragVerfasst: So 01.07.07 18:18 
Schon ok... Wäre zwar schön gewesen, aber kann man ja auch nicht ändern. Gibt es sonst gar keine andere Möglichkeit?

Gruß,

Finn