Autor Beitrag
No0B
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 01.05.10 20:38 
Würde gerne mein Programm beim öffnen einfaden oder sonst irgendwie "weicher" öffnen lassen.
Beim schliessen habe ich nen Timer drin mit Alphablend, würde es beim öffnen aber gerne anders machen vll wie bei Windows.
Hat da jemand ne Idee ?
Webo
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 577
Erhaltene Danke: 14

Win 7, Debian
C# (Visual Studio 2013), PHP, C, C++ (Eclipse, KDevelop)
BeitragVerfasst: Sa 01.05.10 20:41 
Warum denn beim Öffnen nen anderen Weg gehen ? AlphaBlend ist dafür doch eine sehr gut Möglichkeit, die ja schon funktioniert. Warum also nicht ein zweites mal anwenden (dann vielleicht mit anderen Timereinstellungen).

_________________
Man kann nur das aus dem Ärmel schütteln, was man auch vorher reingesteckt hat.
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 01.05.10 20:52 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Timer2Timer(Sender: TObject);
begin
Form1.AlphaBlend:=True; 
Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 5;
if Form1.AlphaBlendValue = 30 then Start;



oder so ?
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 01.05.10 21:21 
Habs mal so versucht, aber der Timer läuft kontinuierlich weiter. Also Programm auf - zu auf zu, wie bleibts offen ?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Timer2Timer(Sender: TObject);
begin
  Timer2.Enabled:=True;
  Form1.AlphaBlend:=True; //Alphablend einschalten
  Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 20;
ALF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1085
Erhaltene Danke: 53

WinXP, Win7, Win10
Delphi 7 Enterprise, XE
BeitragVerfasst: Sa 01.05.10 21:45 
Hi, Du must natürlich mal das AlphaBlendValue abfragen und dann den Timer auf false setzten :wink:

Gruss Alf

_________________
Wenn jeder alles kann oder wüsste und keiner hätt' ne Frage mehr, omg, währe dieses Forum leer!
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: Sa 01.05.10 21:49 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Timer2Timer(Sender: TObject);
begin
  Timer2.Enabled:=True;
  Form1.AlphaBlend:=True;
  Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 20;
  if Form1.AlphaBlendValue = 100 then
  Timer2.Enabled:=false;

end;


geht aber leider auch nicht :(
ALF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1085
Erhaltene Danke: 53

WinXP, Win7, Win10
Delphi 7 Enterprise, XE
BeitragVerfasst: Sa 01.05.10 21:58 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm1.Timer2Timer(Sender: TObject);
begin
  Timer2.Enabled:=True;
  Form1.AlphaBlend:=True;
  Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 20;
  if Form1.AlphaBlendValue = 100 then
  Timer2.Enabled:=false;

end;

nimm mal das markierte raus und setzt es dahin wo Du das blending starten willst, nicht im Timer selbst.
und ändere mal
ausblenden Delphi-Quelltext
1:
2:
if Form1.AlphaBlendValue >100 then
  Timer2.Enabled:=false;

das müsste dann auch funcen!

Gruss Alf

_________________
Wenn jeder alles kann oder wüsste und keiner hätt' ne Frage mehr, omg, währe dieses Forum leer!
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: So 02.05.10 00:12 
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 02.05.10 16:19 
@ALF

habs mal so versucht , geht aber leider auch nicht. Wo liegt mein Problem. Das ist die erste Procedure im Code. Timer 2 steht auf False Interval 20. Das Programm ist aber nur leicht zu sehen. Das Alphablend zum ausfaden habe ich mal weggeschalten.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm1.FormCreate(Sender: TObject);
begin
 Timer2.Enabled:=True;
 Form1.AlphaBlend:=True;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin

  Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 20;
  if Form1.AlphaBlendValue >= 100 then
  Form1.AlphaBlend:=false;
  Timer2.Enabled:=false;

end;
ALF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1085
Erhaltene Danke: 53

WinXP, Win7, Win10
Delphi 7 Enterprise, XE
BeitragVerfasst: So 02.05.10 16:31 
wenn dann nur so
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 20;
if Form1.AlphaBlendValue >= 100 then
begin
  Form1.AlphaBlend:=false;
  Timer2.Enabled:=false;
end;


Gruss Alf

_________________
Wenn jeder alles kann oder wüsste und keiner hätt' ne Frage mehr, omg, währe dieses Forum leer!
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 02.05.10 17:04 
Hab ich gemacht, aber wie vorher Fadet die Form ein wie gewünscht und nach dem einfadem schliesst sie sich wieder und Fadet erneut ein usw. wie ein Blinklicht :D Fehlt da ne Procedure oder so ?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Form1.AlphaBlendValue:=Form1.AlphaBlendValue + 20;
if Form1.AlphaBlendValue >= 100 then
begin
  Form1.AlphaBlend:=false;
  Timer2.Enabled:=false;
end;
No0B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62



BeitragVerfasst: So 02.05.10 17:24 
Vielleicht hilft das ja weiter, hab beim Compilieren ne Warnung
[DCC Warnung] main.pas(59): W1021 Der Vergleich ergibt immer False
ALF
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1085
Erhaltene Danke: 53

WinXP, Win7, Win10
Delphi 7 Enterprise, XE
BeitragVerfasst: So 02.05.10 17:28 
Ich befürchte, da hast Du irgenwo noch was stehen, was das ganze zum fade in/out führt!
Die Fehlerzeile ohne Quelltext nützt gar nichts!

Hier mal nen Vorschlag, so funct es Super :wink:
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:
56:
57:
58:
59:
60:
61:
62:
63:
64:
private
    FadeInOut: Boolean;
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
    FadeInOut := True;
    AlphaBlendValue := 0;
    AlphaBlend := True;
    Timer1.Interval := 50;
    Timer1.Enabled := True;

end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
    if FadeInOut then
    begin
        AlphaBlendValue := AlphaBlendValue + 5;
        if AlphaBlendValue >= 255 then
        begin
            FadeInOut := False;
            Timer1.Enabled := False;
       end;
    end
    else
    begin
        AlphaBlendValue := AlphaBlendValue - 5;
        if AlphaBlendValue <=0 then
        begin
            Timer1.Enabled := False;
            Application.Terminate;
       end;
    end;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
    //hier müssen evtl. je nach programm, noch dinge free gemacht werden
    //um keine Speicherleichen zu haben

    if canclose then
    begin
        canclose := False;
        Timer1.Enabled := True;
    end
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
    close;
end;

end.

Gruss Alf

_________________
Wenn jeder alles kann oder wüsste und keiner hätt' ne Frage mehr, omg, währe dieses Forum leer!