Autor Beitrag
Jukka
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107

Win XP Pro
Delphi 7
BeitragVerfasst: Di 12.09.06 21:08 
Ich will bei einem bild einen MouseOver effect machen jedoch geht das nicht wie gewollt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var OnImage : Boolean = False;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
OnImage := not(OnImage);
if OnImage then image1.picture.LoadFromFile('1.gif'
else image1.picture.LoadFromFile('2.gif'
end;


Jedoch das bild geht rein ja aber nichtmerh raus, bitte um hilfe

MfG Jukka
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Di 12.09.06 23:18 
image1.picture.LoadFromFile('2.gif') machst du im OnMouseMove der Form. :wink:
Jukka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107

Win XP Pro
Delphi 7
BeitragVerfasst: Mi 13.09.06 21:10 
user profile iconCoder hat folgendes geschrieben:
image1.picture.LoadFromFile('2.gif') machst du im OnMouseMove der Form. :wink:


simpel .. aber logisch :)

Danke
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mi 13.09.06 22:23 
Achso
Wenn du das so machst wird bei jeder Mausbewegung das Bild geladen.
Das ist Performancetechnisch etwas ungünstig. :wink:
Am besten du überprüfst vorher ob das Bild schon geladen wurde.

Noch besser wäre wenn du die Bilder aus einer ImageList oder einer Ressource lädst.

MfG
Jukka Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 107

Win XP Pro
Delphi 7
BeitragVerfasst: Do 14.09.06 15:21 
Ja schon gemerkt ^^ hab ne Varibale Boolean, geamcht und gesetzt und dann das bild aus ner ressource gelesen die ich extra einbinde

trodzdem danke ^^