如何在一个 panel 中动态增加 image,并设置 image的 picture 属性?(100分)

T

tom12345

Unregistered / Unconfirmed
GUEST, unregistred user!
如何在一个 panel 中动态增加 image,并设置 image的 picture 属性?
 
H

hfghfghfg

Unregistered / Unconfirmed
GUEST, unregistred user!
var
img:TImage;
begin
img:=TImage.Create(self);
img.top:=1;
img.Left:=1;
img.Width:=100;
img.Height:=100;
img.Picture.LoadFromFile('c:/1.bmp');
img.Parent:=Panel1;
 
T

tom12345

Unregistered / Unconfirmed
GUEST, unregistred user!
hfghfghfg, img.Picture.LoadFromFile('c:/1.bmp');
出错,去掉后运行没反应。
 
S

smlabc

Unregistered / Unconfirmed
GUEST, unregistred user!
img.Picture.Bitmap.LoadFromFile('c:/1.bmp');
 
D

duxing

Unregistered / Unconfirmed
GUEST, unregistred user!
hfghfghfg 应该是对的吧~~
 
T

tom12345

Unregistered / Unconfirmed
GUEST, unregistred user!
smlabc,不出错了,但还是没反应。
 
W

wqhatnet

Unregistered / Unconfirmed
GUEST, unregistred user!
我测试过了
很对
var
img:TImage;
begin
img:=TImage.Create(self);
img.top:=1;
img.Left:=1;
img.Width:=1000;
img.Height:=1000;
img.Picture.Bitmap.LoadFromFile('c:/1.bmp');
img.Parent:=Panel1;
end;
记住C盘要有"'c:/1.bmp'"的
 
Top Bottom