Autor Beitrag
achi 3.0
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Di 27.05.08 08:24 
Hallo,

wisst ihr wie die genaue Syntax für das Laden eines Pfads in Glyph.

Wollte es so machen: bitbtn.Glyph:=C:\.............;

damit wollte ich verschiedene Bilder zu verschiedenen zuständen realisieren.



mfg


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am Di 27.05.2008 um 11:04
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Di 27.05.08 09:06 
Schau dir mal dzu ImageList an das wäre wohl am einfachsten.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Di 27.05.08 11:02 
Wenn du bei deiner Methode bleiben willst: BitBtn.Glyph.LoadFromFile('C:\...');
achi 3.0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Di 27.05.08 11:57 
danke für die ideen aber mit dem BitBtn1.Glyph.LoadFromFile('C:\gruen') klappt es nicht Fehlermeldung: Im Projekt Project2.exe ist eine Exeption der Klasse EFOpenError aufgetreten. Meldung: 'Datei C:\gruen kann nicht geöffnet werden'.
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Di 27.05.08 12:03 
Möglicherweise gibt's die Datei nicht? Da gehört doch sicher noch ein .bmp oder so hinter den Dateinamen.
achi 3.0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Di 27.05.08 12:09 
oder was ist zum beispiel hier falsch



BitBtn1.Glyph:=ImageList1.getBitmap (0,Bitmap);
achi 3.0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Di 27.05.08 12:11 
@nagel



danke dir lag wirklich an .bmp




wäre cool wenn wird die andere methode auch hinbekommen aber die erste geht schonmal :-)
nagel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 708

Win7, Ubuntu 10.10

BeitragVerfasst: Di 27.05.08 13:59 
Sollte so gehen: ImageList.GetBitmap(0, BitBtn.Glyph);
achi 3.0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Di 27.05.08 14:53 
und nochmals


@nagel


Dankeschön klappt alles wunderbar aber eine Frage habe in noch.....In der Hilfe steht immer viel Text aber keine Beispielsyntax oder so woher soll man die Syntax sonst kennen. Bin doch nicht..........



mfg
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Di 27.05.08 15:30 
Steht doch alles da... mal davon abgesehen, dass es in der Hilfe den Link 'Delphi-Beispiel' gibt.
Die Delphi-Hilfe hat folgendes geschrieben:
In diesem Beispiel wird ein in der Bilderliste ImageList enthaltenes Bitmap der Eigenschaft Picture einer TImage-Komponente zugewiesen und angezeigt.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure Form1.Button1Click(Sender: TObject);
begin
   ImageList1.GetBitmap(0,Image1.Picture.Bitmap);
end;



Der Kopf sagt doch aber auch schon alles:
ausblenden Delphi-Quelltext
1:
procedure GetBitmap(Index: Integer; Image: TBitmap);					

Erwartet also den Index und ein TBitmap. TBitBtn.Glyph ist zufälligerweise auch vom Typ TBitmap (sagt die Hilfe). Was könnte man denn da machen :gruebel:

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."