Autor Beitrag
whitef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: Do 21.06.07 21:37 
Hallo,

ich hab in meinem programm n logo (Timage),
ich wollte aber gerne mit einem button das so machen, das wenn man drauf klickt, sich ein anderes bild da rein setzt.

wo lade ich die ganzen bilder rein?
so dass sie dann per knopfdrück sich darein setzen

onclick = next picture.... sowas in der art ;)


mfg
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 21.06.07 21:40 
Am Einfachsten legst du die Bilder in eine Imageliste und überträgst sie dann ins Image.

_________________
Markus Kinzler.
whitef Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: Do 21.06.07 21:49 
wo finde ich den solche eine liste?
und wie übertrage ich sie dann?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 22.06.07 06:53 
[quote="user profile iconwhitef"]wo finde ich den solche eine liste?[quote]
TImageList unter "Win32"
Zitat:
und wie übertrage ich sie dann?

ausblenden Delphi-Quelltext
1:
ImageList.GetBitmap( <Nr>, Image.Picture.Bitmap);					

_________________
Markus Kinzler.
whitef Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 202
Erhaltene Danke: 1

Windows X
Delphi XE X
BeitragVerfasst: Fr 22.06.07 14:37 
soweit so gut... alerdings... noch eins.

wie gebe ich jetzt dem befehl zum bildwechsel?!


also ich habe nun 4 bilder drin.
per knopfdruck soll immer eins weiter gehen (, mit dem anderen knopf zurück).
aber es ist ja bestimmt schwachsinnig mit if abfrage zu arbeiten...

gibt es da noch eine andere methode?
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 22.06.07 14:42 
zb.Variable, inc, dec

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

Windows X
Delphi XE X
BeitragVerfasst: Fr 22.06.07 15:10 
ok danke!

allerdings bin ich doofi in sachen neues... ich brauch beispiel, an hand dieser bekomm ich dann immer den dreh raus, wie auch den umfang...
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 22.06.07 15:22 
Kein Problem :wink:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
 MyVariable:Integer;
procedure TForm1.ErhoeheClick(Sender: TObject);
begin
 Inc(MyVariable);
 Caption:=IntToStr(MyVariable);
end;

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

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 22.06.07 15:34 
und wie soll man das dann in das Bild laden?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 22.06.07 15:43 
ausblenden Delphi-Quelltext
1:
ImageList.GetBitmap( MyVariable, Image.Picture.Bitmap);					

_________________
Markus Kinzler.
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 22.06.07 15:47 
ok, lesen hilft...
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 22.06.07 16:31 
häh?
was mach ich falsch, das immer noch kein anderes Bild angezeigt wird?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  BitBtn1.Enabled := false;
  BitBtn2.Enabled := true;
  while not wuerfeln_stop do
  begin
    gewuerfelt := Random(6) + 1;
    ImageList1.GetBitmap(gewuerfelt - 1, Image1.Picture.Bitmap);
    Application.ProcessMessages;
  end;
  BitBtn1.Enabled := true;
  BitBtn2.Enabled := false;
  wuerfeln_stop := false;
  Memo1.Lines.Add('Du hast eine ' + IntToStr(gewuerfelt) + ' gewürfelt!');
end;
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 22.06.07 16:33 
Füge mal ein Form1.Update; ein

_________________
Markus Kinzler.
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 22.06.07 16:36 
geht nicht... :bawling:
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Fr 22.06.07 16:50 
ausblenden Delphi-Quelltext
1:
Image.Repaint;					

_________________
Markus Kinzler.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 22.06.07 17:02 
Ich biete auch noch einen - Image.Refresh :wink:

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

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: Fr 22.06.07 17:03 
okay, habs verstanden...