Z
zxqht
Unregistered / Unconfirmed
GUEST, unregistred user!
我再转化ticon到tbitmap时,出现运行错误:ticon image is invalid !程序如下
procedure tform1.button1click(sender:tobject);
var
aa:ticon;
bb:tbitmap;
begin
try
aa:=ticon.create;
bb:=tbitmap.create;
if openpicturedialog1.execute then
aa.loadfromfile(openpicturedialog1.filename);
bb.width:=aa.width;
bb.height:=aa.height;
bb.canvas.draw(0,0,aa);
image1.picture.bitmap:=bb;
finally
aa.free;
bb.free;
end;
end;
procedure tform1.button1click(sender:tobject);
var
aa:ticon;
bb:tbitmap;
begin
try
aa:=ticon.create;
bb:=tbitmap.create;
if openpicturedialog1.execute then
aa.loadfromfile(openpicturedialog1.filename);
bb.width:=aa.width;
bb.height:=aa.height;
bb.canvas.draw(0,0,aa);
image1.picture.bitmap:=bb;
finally
aa.free;
bb.free;
end;
end;