const MaxSize = 10; var MyImage: Array of TImage; begin SetLength(MyImage, MaxSize); for i := Low(MyImage) to High(MyImage) do begin MyImage[i] := TImage.Create(Self); //设置相关属 end; end;
var image: array[0..100]of timage; begin image:=timage.create(self); image.parent:=panel; image1.loadfromfile(); image1.canvas... .... end;
myimage[i]:=TImage.create(self); with myimage[i] do begin 设置属性 end;
var image: array[0..100]of timage; begin image[i]:=timage.create(self); image[i].parent:=panel; image[i][.loadfromfile(); image[i].canvas... .... end; 更正。
var image:array[0..10]of timage; i:integer; begin for i:=1 to 3do begin image[i]:=TImage.create(self); image[i].parent:=panel1; image[i].picture.bitmap.loadfromfile('c:\cf\2.bmp'); image[i].height:=100; image[i].width:=200; image[i].Top:=i*10; image[i].Left:=(i-1)*10; end; 以上是完整的,要注意设置left,top,否则有些会显示不出来。
MaxSize = 10;
var
MyImage: Array of TImage;
begin
SetLength(MyImage, MaxSize);
for i := Low(MyImage) to High(MyImage) do
begin
MyImage[i] := TImage.Create(Self);
//设置相关属
end;
end;
image: array[0..100]of timage;
begin
image:=timage.create(self);
image.parent:=panel;
image1.loadfromfile();
image1.canvas...
....
end;
with myimage[i] do
begin
设置属性
end;
image: array[0..100]of timage;
begin
image[i]:=timage.create(self);
image[i].parent:=panel;
image[i][.loadfromfile();
image[i].canvas...
....
end;
更正。
image:array[0..10]of timage;
i:integer;
begin
for i:=1 to 3do
begin
image[i]:=TImage.create(self);
image[i].parent:=panel1;
image[i].picture.bitmap.loadfromfile('c:\cf\2.bmp');
image[i].height:=100;
image[i].width:=200;
image[i].Top:=i*10;
image[i].Left:=(i-1)*10;
end;
以上是完整的,要注意设置left,top,否则有些会显示不出来。