(Gast)
n/a Beiträge
|
AW: Linien beim zeichnen anzeigen lassen
20. Apr 2015, 16:18
SLEEP-Funktionen innerhalb von Graphik-Funktionen zeigen unerwartete Ergebnisse.
Delphi-Quellcode:
procedure Delay(msecs:integer);
var
FirstTickCount:longint;
begin
FirstTickCount:=GetTickCount;
repeat
Application.ProcessMessages;
until ((GetTickCount-FirstTickCount) >= Longint(msecs));
end;
procedure TForm1.Button6Click(Sender: TObject);
var D : integer;
begin
D:=1000;
with Canvas do
begin
Pen.Width:=5;
Pen.Color := clLime;
MoveTo(100,200);
LineTo(100,100); Delay(D);
LineTo(200,100); Delay(D);
LineTo(150,50); Delay(D);
LineTo(100,100); Delay(D);
LineTo(200,200); Delay(D);
LineTo(100,200); Delay(D);
LineTo(200,100); Delay(D);
LineTo(200,200);
end;
end;
procedure TForm1.Button8Click(Sender: TObject);
var D : integer;
begin
D:=1000;
with Canvas do
begin
Pen.Width:=5;
Pen.Color := clRed;
MoveTo(100,200);
LineTo(100,100); SLEEP(D);
LineTo(200,100); SLEEP(D);
LineTo(150,50); SLEEP(D);
LineTo(100,100); SLEEP(D);
LineTo(200,200); SLEEP(D);
LineTo(100,200); SLEEP(D);
LineTo(200,100); SLEEP(D);
LineTo(200,200);
end;
end;
Geändert von hathor (20. Apr 2015 um 16:29 Uhr)
|
|
Zitat
|