云
云影
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了一个画多变型的过程:procedure drawstar(r1,r2,n:integer ;cpoint:tpoint;canvas:tcanvas);
var
i:integer;
corner:real;
pt:array of tpoint;
begin
corner:=6.28/n;
setlength(pt,2*n+1);
for i:=0 to n do
begin
pt[2*i]:=point(cpoint.X+round(r1*sin(I*(corner))),cpoint.Y+round(r1*cos(I*corner)));
pt[2*i+1]:=point(cpoint.X+round(r2*sin((I+0.5)*corner)),cpoint.Y+round(r2*cos((I+0.5)*corner)));
end;
canvas.Polyline(pt);
end;但调试时总是出错;有时出现堆栈出错,请高手帮忙,不胜感激;
My E-mail : fromicbc@sina.com
var
i:integer;
corner:real;
pt:array of tpoint;
begin
corner:=6.28/n;
setlength(pt,2*n+1);
for i:=0 to n do
begin
pt[2*i]:=point(cpoint.X+round(r1*sin(I*(corner))),cpoint.Y+round(r1*cos(I*corner)));
pt[2*i+1]:=point(cpoint.X+round(r2*sin((I+0.5)*corner)),cpoint.Y+round(r2*cos((I+0.5)*corner)));
end;
canvas.Polyline(pt);
end;但调试时总是出错;有时出现堆栈出错,请高手帮忙,不胜感激;
My E-mail : fromicbc@sina.com