Autor Beitrag
Delphi-Zone
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 7
Delphi 7.0 Prof
BeitragVerfasst: Sa 25.09.10 13:13 
Hallo,

Ich hab verschiedene Image und ich möchte das er die in gewissen zeit abständen in bewegung bringt.
das erst ein image erschnéint. das es denn verschwindet, und zeitgleich ein anderes auftaucht. und das mit relativ
vielen image.

Gruß Tom


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 26.09.2010 um 00:39
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 25.09.10 13:36 
Und wo ist jetzt das Problem dabei? :gruebel:

Bei der Logik? Bei deinem aktuellen Code? Bei der Umsetzung?
Delphi-Zone Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45

Win 7
Delphi 7.0 Prof
BeitragVerfasst: Sa 25.09.10 13:42 
Beim Code!

Angennomen ich hab 2 Images,

Erst will ich 1ns erscheinen lassen, denn das andere.

Denn hab ich geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
images1.visible:=true;
image2.visible:=false;
image1.visible:=false;
image2.visible:=true;


wenn ich das denn ausühre, zeigt er nach 1ner Sekunde nur image2 an. das liegt ja daran das image1 denn
false ist und image2 true. aber wie bringe ichda jetzt zeitabstände rein? das er eines nach dem anderen zeigt und versteckt
?

Gruß Tom
platzwart
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1054
Erhaltene Danke: 78

Win 7, Ubuntu 9.10
Delphi 2007 Pro, C++, Qt
BeitragVerfasst: Sa 25.09.10 13:55 
Ich will dir nicht zu nahe treten, aber du hast doch die Links zu den Tutorials bekommen. Wenn du die durcharbeitest, fallen viele Grundlegenden Fragen weg. Un da du einen recht interessierten Eindruck bezüglich Programmieren machst, wirst du die Tutorials auch recht schnell abgearbeitet haben. Der Lerneffekt beim Erstellen von 5 Fragen pro Tag zu stellen und dafür fertigen Quellcode zu bekommen ist gleich null...

_________________
Wissenschaft schafft Wissenschaft, denn Wissenschaft ist Wissenschaft, die mit Wissen und Schaffen Wissen schafft. (myself)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19339
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 25.09.10 14:25 
Dir ist noch nicht klar was ein Timer macht. Schau dir einmal die Hilfe dazu an.

Der Code, den du in das Timerereignis schreibst, wird alle X Millisekunden (je nachdem was du da einstellst) ausgeführt.

Du musst also je nach Zustand (Variable, Sichtbarkeit der Images, ...) entscheiden was du dann nach dem Intervall tust.
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Sa 25.09.10 14:30 
Nimm einfach den Negator not.

ausblenden Delphi-Quelltext
1:
2:
3:
  a     not a
True    False
False   True
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 25.09.10 17:28 
Hey,

noch ein kleiner Tipp zum Ansatz:
nummerier deine Images durch, von 1 bis X. Dann machst du dir ne Variable, die den Index der aktuellen Image speichert. Und im Timer gehst du dann mit einer for-Schleife durch alle Images durch. Wenn die Schleifenvariable gleich dem aktuellen Index der Image ist, dann setzt du Visible auf True, wenn nicht auf False. An die Images kommst du mit FindComponent ran.
Das sollten genug Stichpunkte sein, um das gnaze umzusetzen. Wenns Probleme oder du nicht weiter kommst guck ma bei Google, oder in der BoardSuche, da findet man viel zu FindComponent. Und wenns gar nich will kannst du gern auch nochma hier fragen ;)

MfG Bergmann.

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
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 25.09.10 17:31 
Wie wäre es mit einer TList (Oder ab generics ein Array of TImage)? Wäre sowas nicht sinnvoller? Da bräucht man dann nur das Array (oder die List) durchgehen und muss nicht mit FindComponent herumhampeln.

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Bergmann89
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1742
Erhaltene Danke: 72

Win7 x64, Ubuntu 11.10
Delphi 7 Personal, Lazarus/FPC 2.2.4, C, C++, C# (Visual Studio 2010), PHP, Java (Netbeans, Eclipse)
BeitragVerfasst: Sa 25.09.10 20:28 
Hey,

dann müsste man aber die Images dynamisch erstellen und das ist für nen Anfänger vlt noch n bisl zu schwer?! Oder man verfrachtet sie im OnCreate in das Arrays bzw. die Liste.

MfG Bergmann.

_________________
Ich weiß nicht viel, lern aber dafür umso schneller^^
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 25.09.10 20:38 
user profile iconBergmann89 hat folgendes geschrieben Zum zitierten Posting springen:
Oder man verfrachtet sie im OnCreate in das Arrays bzw. die Liste.

MfG Bergmann.


Jap. Verbraucht nur minimal mehr Speicherplatz als wenn man sie "normal" erstellt, man lernt dazu. :) Insofern nur Vorteile^^

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.