Einzelnen Beitrag anzeigen

Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.755 Beiträge
 
Delphi 10.4 Sydney
 
#6

Re: [Help!]Simulation eines Doppelschiebers

  Alt 9. Jun 2006, 21:00
Du kannst mal die Funktion delay von Hagen so einfügen (wie marabu bereits vorgeschlagen hat):
Delphi-Quellcode:
implementation

{$R *.dfm}

procedure Delay(Milliseconds: Integer);
var
  Tick: DWord;
  Event: THandle;
begin
  Event := CreateEvent(nil, False, False, nil);
  try
    Tick := GetTickCount + DWord(Milliseconds);
    while (Milliseconds > 0) and
          (MsgWaitForMultipleObjects(1, Event, False, Milliseconds, QS_ALLINPUT) <> WAIT_TIMEOUT) do
    begin
      Application.ProcessMessages;
      if Application.Terminated then Exit;
      Milliseconds := Tick - GetTickcount;
    end;
  finally
    CloseHandle(Event);
  end;
end;
und delay hier aufrufen:
Delphi-Quellcode:
     
       moveto(Pixel[laufvar].x,Pixel[laufvar].y);
       lineto(Pixel[laufvar-1].x,Pixel[laufvar-1].y);
       delay(50);
    until PunktA[laufvar].y>579;
Dann wird Deine Kurve in jedem Schleifendurchlauf um 50 ms verzögert.

Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat