W
wjdragon
Unregistered / Unconfirmed
GUEST, unregistred user!
我在tabsheet上放了一个image,以tabsheet为父类随机创建了多个shape,如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Image1: TImage;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
shape: array[1..250] of TShape;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
i:integer;
begin
for i:=1 to 250do
begin
shape := TShape.Create(TabSheet1);
with shapedo
begin
parent:=TabSheet1;
top := random(380);
left:= random(580);
width:= 10;
height:=10;
visible:=true;
enabled:=true;
end;
end;
end;
end.
在这之后,我将要在image的canvas上画若干条连线(连接每对shape)。
现在我想要打印出这个拓扑图形(用直线连接的若干个shape),怎样实现这个要求呢?我认为shape的打印是个问题.请各路高手给于建议,谢谢
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Image1: TImage;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
shape: array[1..250] of TShape;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
i:integer;
begin
for i:=1 to 250do
begin
shape := TShape.Create(TabSheet1);
with shapedo
begin
parent:=TabSheet1;
top := random(380);
left:= random(580);
width:= 10;
height:=10;
visible:=true;
enabled:=true;
end;
end;
end;
end.
在这之后,我将要在image的canvas上画若干条连线(连接每对shape)。
现在我想要打印出这个拓扑图形(用直线连接的若干个shape),怎样实现这个要求呢?我认为shape的打印是个问题.请各路高手给于建议,谢谢