Autor Beitrag
Delphi2009lover
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 176



BeitragVerfasst: Mi 22.04.09 14:31 
Sry, ich bin ganz neu bei Delphi. Ich habe mir die Tutorials auf Delphi-Treff durchglesen. Haben aber leider nicht wirklich geholfen.

Meine Frage: Ich bin im Menü auf Projekt - Ressourcen... und habe ein Bild hinzugefügt (Bild.jpg) wie kann ich per Code das jetzt als Bild von Image1 machen?

Sry für die "Baby-Frage" hatte vorher nur mit VB2008 zu tun^^



In VB hab ich das so gemacht:

ausblenden Quelltext
1:
Picturebox1.Image = My.Ressources.Bild.jpg					



würde mich freuen, wenn mir jemand antwortet
Naxor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

alle
delphi, C++, php, html, java, flash, XML
BeitragVerfasst: Mi 22.04.09 14:34 
schau mal hier vieleicht hilft dir das ein wenig

www.delphi-forum.de/viewtopic.php?t=90777
Delphi2009lover Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 176



BeitragVerfasst: Mi 22.04.09 14:41 
KA. Danke jedenfalls für die Antwort. Wie ich schon sage. Ich hab halt erst neu angefangen.


Ich denke mal das Bild kann man so ändern: Ist jetzt ein Test bitte nich lachen^^


Image1.Picture:= "jetzt das Bild der Ressource"

Ka wie ich weiterkomme.


Es soll halt so sein, dass da ein Button ist und wenn man draufklickt ist in dem Image1 das BIld "Bild.jpg" drinnen
Naxor
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

alle
delphi, C++, php, html, java, flash, XML
BeitragVerfasst: Mi 22.04.09 14:43 
bei delphi gibs links eine navigations leiste wenn du das Timage object angeklickt hast solltest du in der spalte Bild oder Picture finden dort kannst du dir das bild suchen und einfügen
Delphi2009lover Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 176



BeitragVerfasst: Mi 22.04.09 14:46 
Sry ich glaube ich erkläre es nochmal.

PS: Des hab ich soger mal gewusst *selbstlob*

Das Image1.Picture soll am Anfang Standart sein (also kein Bild) wenn ich auf Button1 klicke, soll Image1.Picture = Bild.jpg sein
Michael Stenzel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 133


D3 Prof, D7 PE
BeitragVerfasst: Mi 22.04.09 15:48 
Hi Delphi2009lover

Schaue dir bitte folgende Methoden an in der Hilfe an.

ausblenden Delphi-Quelltext
1:
2:
  Image1.Picture.Bitmap.LoadFromResourceName();
  Image1.Picture.Bitmap.LoadFromResourceID();


Gruß
Michael.
Delphi2009lover Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 176



BeitragVerfasst: Do 23.04.09 15:42 
So danke erstmal

wenn jetzt der Ressourcenbezeichner = "JPG_01" und der Dateiname = "Bild.jpg" wie muss ich den Code dann für die Ressource schreiben??


Danke schon mal im VorrAUS