陈
陈君凯
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm2.FormPaint(Sender: TObject);
var
shaped:array of TShape;
lab:array of TLabel;
i,j:integer;
q:nodeptr;
w,h:integer;
begin
SetLength(shaped, n+1);
for i:=1 to n do
begin
shaped:=TShape.Create(self);
shaped.Parent:=Self;
shaped.Height:=30;
shaped.Width:=30;
shaped.Top:=adj.zby;
shaped.Left:=adj.zbx;
shaped.Brush.Color:=clGreen;
shaped.Pen.Color:=clNavy;
shaped.Pen.Mode:=pmCopy;
shaped.Pen.Style:=psSolid;
shaped.Pen.Width:=1;
shaped.Shape:=stCircle;
end;
for i:=1 to n do
begin
q:=adj.link;
while q<>nil do
begin
Form2.Image1.Canvas.Pen.Color:=clOlive;
Form2.Image1.Canvas.Pen.Width:=1;
Form2.Image1.Canvas.MoveTo(adj.zbx+30,adj.zby+15);
Form2.Image1.Canvas.LineTo(adj[q^.num].zbx,adj[q^.num].zby+15);
q:=q^.link
end;
end;
for i:=1 to l do
begin
Form2.Image1.Canvas.Pen.Color:=clRed;
Form2.Image1.Canvas.Pen.Width:=2;
Form2.Image1.Canvas.MoveTo(adj[pre.x].zbx+30,adj[pre.x].zby+15);
Form2.Image1.Canvas.LineTo(adj[pre.y].zbx,adj[pre.y].zby+15);
end;
var
shaped:array of TShape;
lab:array of TLabel;
i,j:integer;
q:nodeptr;
w,h:integer;
begin
SetLength(shaped, n+1);
for i:=1 to n do
begin
shaped:=TShape.Create(self);
shaped.Parent:=Self;
shaped.Height:=30;
shaped.Width:=30;
shaped.Top:=adj.zby;
shaped.Left:=adj.zbx;
shaped.Brush.Color:=clGreen;
shaped.Pen.Color:=clNavy;
shaped.Pen.Mode:=pmCopy;
shaped.Pen.Style:=psSolid;
shaped.Pen.Width:=1;
shaped.Shape:=stCircle;
end;
for i:=1 to n do
begin
q:=adj.link;
while q<>nil do
begin
Form2.Image1.Canvas.Pen.Color:=clOlive;
Form2.Image1.Canvas.Pen.Width:=1;
Form2.Image1.Canvas.MoveTo(adj.zbx+30,adj.zby+15);
Form2.Image1.Canvas.LineTo(adj[q^.num].zbx,adj[q^.num].zby+15);
q:=q^.link
end;
end;
for i:=1 to l do
begin
Form2.Image1.Canvas.Pen.Color:=clRed;
Form2.Image1.Canvas.Pen.Width:=2;
Form2.Image1.Canvas.MoveTo(adj[pre.x].zbx+30,adj[pre.x].zby+15);
Form2.Image1.Canvas.LineTo(adj[pre.y].zbx,adj[pre.y].zby+15);
end;