Autor Beitrag
Kujo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 03.03.07 23:06 
Hi leute ich hab folgendes und zwar will ich Bilder hintereinander laufen lassen,
sodass eine Art Animation entsteht. Aber irgendwie funktioniert das nich so wie es soll.
Bis jetzt sieht es so aus:

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:
37:
38:
39:
40:
41:
42:
43:
44:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
image21.Visible:=true;

if image21.Visible = true
then begin
   image21.Visible:= false;
   image22.Visible:=true;

end

 else if image22.Visible = true
then begin
   image22.Visible:= false;
   image23.Visible:=true;

end

else if image23.Visible = true
then begin
   image23.Visible:= false;
   image24.Visible:=true;

end

else if image24.Visible = true
then begin
   image24.Visible:= false;
   image25.Visible:=true;

end

else if image25.Visible = true
then begin
   image25.Visible:= false;
   image26.Visible:=true;

end
else if image26.Visible = true
then begin
   image26.Visible:= false;
   image21.Visible:=true;

end


Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Sa 03.03.07 23:21 
pack doch die bidler in einen ordner wo die exe ist und dann mach folgendes:
1 TIMAGE
im timer von meinetwegen 42 milisekunden (enspricht etwa 24 bilder in der skeunde)
setz form1.DoubleBuffered := True;
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var i: integer;
begin
inc(i);
Image1.picture.loadfromfile(i+'.jpg');
if (i = 24) then i := 0;
end;


Damit sollte er jede seekunde alle 24 bilder einmal durchaben ^^ (ps 16 bilder inna sekunde(62 millisekunden) sollten auch reichen da unser gehirn nicht wirklich mehr wahrnehmen kann soweit ich weis)
Kujo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 03.03.07 23:23 
Für was steht das "form1.DoubleBuffered := True;" und wo muss ich das einsetzen?
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Sa 03.03.07 23:40 
Das verringert das falckern wennde schnell bilder wechselst oder verschiebst. ähnlicher effect wie bei verticale syncronisation
das kannste beim FormCreate reintun
Kujo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: Sa 03.03.07 23:41 
Es kommt immer eine Fehlermeldung-
[Fehler] Unit1.pas(118): Inkompatible Typen: 'String' und 'Integer'
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 03.03.07 23:51 
IntToStr(i)+'.jpg'

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



BeitragVerfasst: So 04.03.07 00:01 
Müssen meine Bilder einen bestimmten Namen haben?
Es kommt immer ne Fehlermeldung.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 04.03.07 00:10 
1.jpg, 2.jpg...
Kujo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: So 04.03.07 00:15 
Ja hab ich, aber es kommt immer ne Fehlermeldung.

procedure TForm1.Timer1Timer(Sender: TObject);
var i: integer;
begin
inc(i);
Image1.picture.loadfromfile(IntToStr(i)+'.jpg');
if (i = 6) then i := 1; <--- in der zeile, es wird irgendwie nicht genutzt
end;

Ich hab es als Bsp. für 6 Bilder. Stimmmt es so?
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 04.03.07 00:34 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
  Form1: TForm1;
  var i: integer;
implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Inc(i);
  if (i = 7) then i := 1;
  Image1.Picture.loadfromfile(ExtractFilePath(ParamStr(0))+IntToStr(i)+'.jpg');
end;

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



BeitragVerfasst: So 04.03.07 09:55 
Das funst immer noch nich. Es kommt die fehlermeldung:
[Warnung] Unit1.pas(119): Variable 'z' ist möglicherweise nicht initialisiert worden

Den anderen fehler habe ich mal anghangen.
Einloggen, um Attachments anzusehen!
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 04.03.07 10:01 
Du musst die Variable z auch so deklarieren wie im Obigen Beispiel. :wink:

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



BeitragVerfasst: So 04.03.07 10:07 
ok jetzt habe ich z mal so deklariert, wie beschrieben. jetzt kommt keine Fehlermeldung, aber es kommt auch kein Bild.

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Inc(z);
if (z = 7) then z := 1;
Image1.Picture.loadfromfile(ExtractFilePath(ParamStr(0))+IntToStr(z)+'.jpg');
end;
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 04.03.07 10:12 
Ist der Timer an ?, Liegen die Bilder im Ordner der Exe ?, heißen die Bilder 1.jpg, 2.jpg...?

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



BeitragVerfasst: So 04.03.07 10:21 
ja der timer ist an, bilder im ornder udn heißen 1,2,3,4,5,6.jpg
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 04.03.07 10:34 
...
Einloggen, um Attachments anzusehen!
_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Kujo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: So 04.03.07 10:41 
geht nich


Zuletzt bearbeitet von Kujo am So 04.03.07 10:52, insgesamt 1-mal bearbeitet
Kujo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 24



BeitragVerfasst: So 04.03.07 10:50 
klasse