Autor Beitrag
duri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Mi 04.01.06 12:25 
hi,

so Bilder einfügen bekomme ich noch hin... wie lasse ich sie Bewegen ?

da war irgendwas per timer ... ich weiß nicht mehr
andras
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 460

Win XP, Win Vista Home Premium, Ubuntu Dapper Drake
Delphi 2005 Pers
BeitragVerfasst: Mi 04.01.06 12:36 
also ich würd mal folgendes vorschlagen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
image1.Left:=image1.Left+10;//das bild bewegt sich 10 pixel nach links
image1.top:=image1.Top+10;  //das bild bewegt sich 10 pixel nach oben
end;

wenn du nach rechts bzw unten willst einfach dein wert niedriger machen (subtrahieren ;) )
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 07.01.06 22:43 
ah hat super geklapt

wie kann ich machen, dass das bild nun anhältt ? das bewegt sich ja ins unendliche..
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 07.01.06 22:52 
Timer1.Enabled:=False; oder Crashkurs.
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 07.01.06 23:00 
*wow*
danke für die schnell antwort :)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
> procedure TForm1.Timer1Timer(Sender: TObject);
begin
image1.Left:=image1.Left-220;
image1.top:=image1.Top-100;
Timer1.Enabled:=False;

image2.Visible:=true;

end;

end.


mein programm dank euch erst mal :)

>>

Letzte frage, wie kann ich ein Bild aufblinken lassen ?
also dass es größer und wieder kleiner wird ?

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 07.01.06 23:07 
Größer & Kleiner ist so eine Sache aber ...
www.delphi-forum.de/...54074&highlight=
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 07.01.06 23:12 
wieder danke !
funkz einwandfrei :)

sry aber noch eine frage :)

Da ich jetzt nun gelernt habe wie man Bilder bewegen kann, möchte ich wissen, wie man sie langsam bewegen lässt.

Bei mir Bewegt sich das Bild ( nach timer 2000) direkt zu dieser stelle... Ich möchte nun, dass es sich schrittweise dahin bewegt..
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 07.01.06 23:17 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Timer1Timer(Sender: TObject);  
begin  
image1.Left:=image1.Left+10;//das bild bewegt sich 10 pixel nach links  
image1.top:=image1.Top+10;  //das bild bewegt sich 10 pixel nach oben  
end;

einfach die 10 durch ne kleinere zahl ersetzen und mit dem timerintervall wirst du nie ne flüssige bewegung bekomm, für sowas nehm ich da mx einen mit 50

EDIT:

@andreas Die kommentwirung ist falsch, so bewegt sich das bild nach rechts unten...
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 07.01.06 23:22 
wenn ich da eine kleine zahl nehme, dann bewegt das bild sich nur noch 1 mal zu dieser stelle.. und bleibt dann stehen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
image1.Left:=image1.Left-20;
image1.top:=image1.Top-10;

Timer1.Enabled:=False;

end;


Moderiert von user profile iconraziel: Doppelposting entfernt.
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 07.01.06 23:25 
jop weil du direkt danach den timer ausschaltest

Timer1.Enabled:=False;
pack das lieber in ein button klick ereignis oder so, halt wann immer du willst das das ding stehn bleibt
wenn du willst das sich das bild aufhört zu bewegen wenn es an einer bestimmten position is, dann mach
ausblenden Delphi-Quelltext
1:
If (Image1.Left = 10) And (Image1.Top = 10) Then Timer1.Enabled:=False;					
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 07.01.06 23:28 
Ist auch ganz normal, Du verschiebst das Bild und stellst den Timer auf false also auf aus dann ist Schluss.
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 07.01.06 23:36 
habe das jetzt so gemacht :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
image1.Left:=image1.Left-10;
image1.top:=image1.Top-10;

If (Image1.Left = -10) And (Image1.Top = -10) Then

Timer1.Enabled:=False;;





>>

trotzdem bewegt der sich ins unendliche

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: Sa 07.01.06 23:43 
mach mal hier draus
ausblenden Delphi-Quelltext
1:
If (Image1.Left = -10) And (Image1.Top = -10) Then					


das hier
ausblenden Delphi-Quelltext
1:
If (Image1.Left < -10) And (Image1.Top < -10) Then					


aber ich würd dir auch echt dringend nen crashkurs in delphi empfehlen ;)

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Sa 07.01.06 23:47 
wenn du da - 10 eingibst bewegt sich das bild 10 pixel aus der form heraus
ich würd auch den so oft genannten crashkurs empfehlen hat jemand den link parat?
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Sa 07.01.06 23:48 
mache sowas in der schule, aber da das hier hausaufgabe ist.. mussten wir es selber irgendwie hinbekommen.. ohne hilfe an einem neuen gebiet :(

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
habe das jetzt so gemacht :

image1.Left:=image1.Left-10;
image1.top:=image1.Top-10;

If (Image1.Left < -20) And (Image1.Top < -10) Then

Timer1.Enabled:=False;


aber das Bild bewegt sich immer noch ins unendliche

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
mtin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 177

Win XP SP2
BDS2006 Enterprise
BeitragVerfasst: So 08.01.06 00:04 
mach ein neues Projekt, klick auf Timage und setz eins so ziemlich in die Mitte, dann machsde noch einen TTimer irgendwohin und klickst den doppelt an.

in das sich nun öffnende codefenster kopierst/schreibst du das hier rein:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
image1.Left:=image1.Left-5;
image1.top:=image1.Top-5;

If (Image1.Left <= 0) or (Image1.Top <= 0) Then

Timer1.Enabled:=False;
end;


dann drückst du compile...tadaaa
keine Ahnung was du da falsch machst...

hier solltest du vielleicht mal reinschauen:
www.dsdt.info/
(dort auf Grundlagen oder so)
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 08.01.06 00:05 
Probier mal das, das ist glaub Ich einfacher zu ...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Timer1.Interval:=500; 
  Image1.Left:=Image1.Left+10;
  Image1.Top:=Image1.Top+10;
  If (Image1.Left = 200) And (Image1.Top = 200) Then
  Timer1.Enabled:=False;;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Image1.Left:=100;
  Image1.Top:=100;
end;
duri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: So 08.01.06 00:09 
TOll danke !

alles wunderbar geklapt : hat nur <= gefehlt =)