Autor Beitrag
SignsOfCore
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: So 23.11.08 20:15 
Hallo!

Und zwar möchte ich, nachdem man mein Programm aufruft, erst 2 Bilder nach 1 Sekunde erscheinen und dann noch eins nach 2, wenn möglich noch mit diesem "langsam-komm" Effekt, dass es erst fast durchsichtig ist und dann immer klarer wird.

Geht das überhaupt? Wenn ja, wie?


Gruß
Core
GericasS
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 540

Windows Vista Home Premium
D2010, VisualStudio2008
BeitragVerfasst: So 23.11.08 20:20 
Ich glaube das könntest du entweder mit einem Timer umsetzten oder mit der Funktion Sleep()

_________________
Alexander N.
Neue Bewaffnung Amilo xi2428 T9300
SignsOfCore Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: So 23.11.08 20:22 
Schön und gut - Wie geht das?^^
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 23.11.08 20:22 
Dafür würde sich vermutlich ein Timer anbieten (Komponentenregister "System"). Den Intervall stellst du auf 1000 ms (=1 sekunde). Nun kannst du in die Prozedur des Timers soetwas schreiben wie
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
  inc(x);
  case x of
    1:
    begin
      Image1.Visible := true;
      Image2.Visible := true;
    end;
    2:
    begin
      Image3.Visible := true;
      Timer1.Enabled := false;
    end;
  end;
end;
Wobei x eine mit 0 initialisierte globale Integer-Variable ist.
Sleep ist vielleicht nicht so doll, da damit dein Programm einfriert (Keine Rückmeldung).

edit: wegen diesem "Einblende" Effekt, das wird etwas schwieriger, da das Standard-Image meines wissens keinen Tranzparenzeffekt unterstützt.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
SignsOfCore Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: So 23.11.08 20:25 
Dankeschön - ist das dass einzige was ich da reinkopieren muss (wo hin?) oder noch irgendetwas.
Steht in meinem lustigen Buch (leider) nicht drinn.


Gruß
Core


edit: Ihr seid ja flinker als flink...
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 23.11.08 20:33 
Ehm - Also mit copy&paste Programmierung kommst du nicht weit ;)

Aber ich will dir mal eine Anleitung geben: Zieh einen Timer von der Registerkarte "System" auf die Form. Das ist eine non-VCL Komponente, die wird im späteren Programm nicht sichtbar sein. Klicke den Timer an. Setze die Eigenschaft "Intervall" auf 1000 (ist vermutlich schon.). Das bedeutet, dass die Prozedur des Timers alle 1000ms ausgeführt wird, bis sein "Enabled" auf false gesetzt wird (der Timer wird deaktiviert). Nun doppelklicke auf den Timer. Du landest im Code in der Prozedur des Timers. Hier gehört der Code rein. Die Variable x muss zuvor noch global deklariert und am besten im FormCreate mit 0 initialisiert werden (auf 0 gesetzt, soll das heißen :) ) Global deklariert heißt in dem fall:
ausblenden Delphi-Quelltext
1:
2:
3:
var
  Form1: TForm1;
  x : Integer;
Etwa an dieser Stelle soll sie stehen.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
SignsOfCore Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: So 23.11.08 20:38 
Ui Danke!

Das geht dann auch mit anderen Sachen oder?
Z.B: Label1.Caption := 'test';


Gruß
Core


Edit: Klappt leider nicht! Hier der Code:
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:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls;

type
  TForm1 = class(TForm)
    Image2: TImage;
    Image1: TImage;
    Image3: TImage;
    Image4: TImage;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var 
  Form1: TForm1; 
  x : Integer;


implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  inc(x); 
  case x of 
    1
    begin
      Image2.Visible := true;
      Image3.Visible := true;
    end;
    2
    begin 
      Image4.Visible := true;
      Timer1.Enabled := false;
    end
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

end.
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: So 23.11.08 20:51 
user profile iconJayEff hat folgendes geschrieben Zum zitierten Posting springen:
Die Variable x muss zuvor noch global deklariert und am besten im FormCreate mit 0 initialisiert werden (auf 0 gesetzt, soll das heißen :) )


user profile iconSignsOfCore hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
 
50:
51:
52:
53:
54:
55:
{ ... }
procedure TForm1.FormCreate(Sender: TObject);
begin
     
  ?  
     
end;

Versuche mal, den Tipp von user profile iconJayEff umzusetzen. :idea:
SignsOfCore Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: So 23.11.08 20:55 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormCreate(Sender: TObject);
begin
     x:= integer  (0);
end;


So?
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: So 23.11.08 21:13 
user profile iconSignsOfCore hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormCreate(Sender: TObject);
begin
     x:= integer  (0);
end;


So?

Das würde IMHO auch gehen, aber das integer(...) kannst du auch weglassen:

ausblenden Delphi-Quelltext
1:
x := 0;					
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 23.11.08 22:20 
user profile iconYogu hat folgendes geschrieben Zum zitierten Posting springen:

Das würde IMHO auch gehen
Richtig, sollte es, denn du Typecastest einen Integer in einen Integer. (Du sagst deinen Program sowas wie "Hier guck, diesen Integer sollst du bitte nicht als Integer sondern als Integer behandeln! :D" )

Ausserdem fehlt (logischerweise) noch etwas, was nicht aus dem Code ersichtlich wird: Du musst die Images, die zuerst mal unsichtbar sein sollen, auf Unsichtbar setzen. Dazu klickst du sie an und änderst den Wert von "visible" im Objektmanager von True auf False.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Tilman
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1405
Erhaltene Danke: 51

Win 7, Android
Turbo Delphi, Eclipse
BeitragVerfasst: Mo 24.11.08 04:32 
Vielleicht hilft dieser Code bei dem problem weiter:
www.delphi-library.d...iewtopic.php?t=71382

_________________
Bringe einen Menschen zum grübeln, dann kannst du heimlich seinen Reis essen.
(Koreanisches Sprichwort)
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 24.11.08 05:19 
Da wirst du bei den vorhandenen Kenntnissen aber wohl noch ein bissl was zu erklären müssen vermute ich einmal ;-).
SignsOfCore Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 22



BeitragVerfasst: Di 25.11.08 16:09 
Dankeschön, hab den Fehler gefunden. Von Sichtbar auf Sichtbar setzten bringt nicht viel :)



Gruß
Core
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Di 25.11.08 16:14 
Klingt plausibel :D