delphi修改点程序 运行不了
usesmath;procedureTForm1.DrawClockLine(Sender:TObject);varp:Tpoint;beginifFNeedEraset...
uses math;
procedure TForm1.DrawClockLine(Sender: TObject);
var
p:Tpoint;
begin
if FNeedErase then
begin
Image1.Canvas.MoveTo(FClockCenter.x,FClockCenter.y);
Image1.Canvas.LineTo(FLastPosition.x,FLastPosition.y);
end;
p:=GetNextPosition;
Image1.Canvas.MoveTo(FClockCenter.x,FClockCenter.y);
Image1.Canvas.LineTo(p.x,p.y);
FlastPosition:=p;
FNeedErase:=True;
end;
function Tform1.GetNextPosition:Tpoint;
var
d:double;
p:Tpoint;
begin
d:=(FLastposition.Y-fclockcenter.y)/Fradius;
if flastposition.x>=fclockcenter.x then
d:=Arcsin(d)+pi/30
else
d:=pi-Arcsin(d)+pi/30;
p.x:=round(fradius*cos(d)+fclockcenter.x);
p.Y:=round(fclockcenter.y+fradius*sin(d));
result:=p;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Fneederase:=false;
fradius:=100;
fclockcenter:=point(100,100);
flastposition:=point(100,0);
image1.canvas.Pen.color:=color;
image1.canvas.Pen.width:=2;
image1.canvas.Pen.mode:=pmnotxor;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
drawclockline;
end;
提示错误:not enough actual paraneters 展开
procedure TForm1.DrawClockLine(Sender: TObject);
var
p:Tpoint;
begin
if FNeedErase then
begin
Image1.Canvas.MoveTo(FClockCenter.x,FClockCenter.y);
Image1.Canvas.LineTo(FLastPosition.x,FLastPosition.y);
end;
p:=GetNextPosition;
Image1.Canvas.MoveTo(FClockCenter.x,FClockCenter.y);
Image1.Canvas.LineTo(p.x,p.y);
FlastPosition:=p;
FNeedErase:=True;
end;
function Tform1.GetNextPosition:Tpoint;
var
d:double;
p:Tpoint;
begin
d:=(FLastposition.Y-fclockcenter.y)/Fradius;
if flastposition.x>=fclockcenter.x then
d:=Arcsin(d)+pi/30
else
d:=pi-Arcsin(d)+pi/30;
p.x:=round(fradius*cos(d)+fclockcenter.x);
p.Y:=round(fclockcenter.y+fradius*sin(d));
result:=p;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Fneederase:=false;
fradius:=100;
fclockcenter:=point(100,100);
flastposition:=point(100,0);
image1.canvas.Pen.color:=color;
image1.canvas.Pen.width:=2;
image1.canvas.Pen.mode:=pmnotxor;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
drawclockline;
end;
提示错误:not enough actual paraneters 展开
3个回答
展开全部
提示错误为缺少参数,改为下面就可以了
procedure TForm1.Timer1Timer(Sender: TObject);
begin
drawclockline(nil);
end;
drawclockline(Sender: TObject)函数需要一个TObject类型的参数
procedure TForm1.Timer1Timer(Sender: TObject);
begin
drawclockline(nil);
end;
drawclockline(Sender: TObject)函数需要一个TObject类型的参数
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
procedure TForm1.Timer1Timer(Sender: TObject);
begin
drawclockline(Sender);
//或者 drawclockline(self);
//或者drawclockline(nil);
end;
begin
drawclockline(Sender);
//或者 drawclockline(self);
//或者drawclockline(nil);
end;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
procedure TForm1.Timer1Timer(Sender: TObject);
begin
drawclockline;
end;
缺少参数
begin
drawclockline;
end;
缺少参数
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询