Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Do 10.08.06 07:41 
Also es bringt ihm doch nichts ihm jetzt jeder sacht gleich Code für ne andere Lösung postet - ich denke er sollte ich nu endlich ma entscheiden was er haben möchte. Jede Version mag Vor- und Nachteile haben aber ich denke das mit den Panels (so wie ers in seiner Frage ja beschrieben hatte) is für einen Einsteiger vlt am besten - und so viel performance kostet das nicht... :wink:

mfg
ShinShan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: So 13.08.06 16:36 
also ich hab mich entschieden!

ich hab es so gemacht:

type
karten=record
Bild:TImage;
wo:TPoint;
end;

var
Karte: array[1..25] of karten;
...

procedure TForm1.Rungame;
var i,j,x,y:byte;
begin
for i:=1 to 25 do
begin
for j:=1 to 2 do
begin
x:=random(639)+1;
y:=random(479)+1;
Karte[i].Bild:=TImage.Create(nil);
Karte[i].Bild.picture.LoadFromFile('E:\desktop\Memorie\Bilder\'+inttostr(i)+'.jpg');
Karte[i].Bild.Show;
end;
end;
end;

allerding zeigt er kein Bild an.
Ich hab auch schon mit den verscheidensten .Show-Anweisungen experimentiert.
Und der Pfad funktioniert auch so wie er da ist.
Das Bild lässt sich auch mit TImage laden.
gibt es noch andere Anweisungen um das Bild anzeigen zu lassen?

DANKE nochmal, dass ihr mir hier so stark helft.
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: So 13.08.06 16:59 
Ehrlich verstehe ich jetzt nicht, wieso nicht ein Standard-Stringgrid verwendet wird?
_frank_
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 343
Erhaltene Danke: 1

Win XP
Delphi 3 Prof / Turbo Delphi Explorer
BeitragVerfasst: So 13.08.06 17:02 
hi,
so sollte es funktionieren (auch wenn das mit den Images auch nicht schön ist...)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
//owner angeben, damit es im destroy des forms mit freigeben wird; 
//self=form1 (in deinem fall,da in procedure TForm1.RunGame)
Karte[i].Bild:=TImage.Create(self);
//Parent Setzen!
Karte[i].Bild.Parent:=self;
//ggf. Position setzen
//Bild laden
Karte[i].Bild.picture.LoadFromFile('E:\desktop\Memorie\Bilder\'+inttostr(i)+'.jpg');
//show brauchste nicht
//Karte[i].Bild.Show;

HTH Frank

//edit: mist nicht schnell genug ;)
//bitte mache das nächste mal delphi-tags [ delphi ]code[ / delphi ] (ohne leerzeichen) rein

_________________
EB FE (die wahrscheinlich kürzeste Endlosschleife der Welt :) )
BA 01 00 00 00 52 EB 09 BB 4D 11 86 7C FF D3 EB 0D E8 F2 FF FF FF 63 68 61 72 6D 61 70 00 C3
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 13.08.06 17:36 
In TImages darfst du kein jp(e)g laden - versuchs mal mit bmps...

mfg
_frank_
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 343
Erhaltene Danke: 1

Win XP
Delphi 3 Prof / Turbo Delphi Explorer
BeitragVerfasst: So 13.08.06 18:00 
das mit dem jpg hab ich gar net gesehen :roll:

also nochmal...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
uses jpeg;

var jpg:TJPEGImage
begin
...
//owner angeben, damit es im destroy des forms mit freigeben wird; 
//self=form1 (in deinem fall,da in procedure TForm1.RunGame)
Karte[i].Bild:=TImage.Create(self);
//Parent Setzen!
Karte[i].Bild.Parent:=self;
//ggf. Position setzen
//Bild laden
jpeg:=TJPEGImage.create;
jpeg.LoadFromFile('E:\desktop\Memorie\Bilder\'+inttostr(i)+'.jpg');
Karte[i].Bild.Picture.Assign(jpeg);
jpeg.free;
//show brauchste nicht
//Karte[i].Bild.Show;


jetzt sollte es funktionieren...

HTH Frank

_________________
EB FE (die wahrscheinlich kürzeste Endlosschleife der Welt :) )
BA 01 00 00 00 52 EB 09 BB 4D 11 86 7C FF D3 EB 0D E8 F2 FF FF FF 63 68 61 72 6D 61 70 00 C3
ShinShan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: So 13.08.06 20:21 
Danke Leute, jetzt ist alles klar, und es funktioniert alles so wie es soll.

Ich muss sage, dieses Forum ist echt verdammt gut!
Reichlich nette Leute hier und man wird geholfen so gut es geht.

DANKE