Курсовая работа: Построение траектории Броуновского движения
canvas.Pen.Width:=3;
scrollbar1.SetParams(80,0,99);
time:=100-scrollbar1.Position;
timer1.Enabled:=false;
end;
procedure tform1.paint;
begin
x2:=random(bevel1.Width)+tx;
y2:=random(bevel1.Height)+ty;
canvas.LineTo(x2,y2);
canvas.Pen.color:=canvas.pen.color+1;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if not timer1.Enabled then
begin
timer1.Enabled:=true;
timer1.Interval:=time;
button1.Caption:='STOP!';
end else
begin
timer1.enabled:=false;
button1.Caption:='GO!';
end;
end;
procedure TForm1.ScrollBar1Change(Sender: TObject);
begin
time:=100-scrollbar1.Position;
timer1.Interval:=time;