Image.Picture.Bitmap.Free;或 Image->Picture->Graphic := nil;
这样合理吗.
这样合理吗.
解决方案 »
- 在vista home basic上安装delphi 7,0的方法
- delphi中怎样修改电脑的日期时间以及IP地址?
- 为什么窗体有时候自己关不掉自已?
- why显示的时间不对
- 如何实现管理权限!100分!
- 如何创建WINDOWS系统256色调色板?
- ◆◆◆◆◆对《 我以后就不能在这发言了,把分给大家》贴的一点看法◆◆◆◆◆
- 文本文件的压缩
- 有些控件没有readonly,有没有什么办法不让编辑,如用其他透明控件遮盖
- 如何判断空行?(给分)
- 求助:如何打印 "select * from db where id<1000" 查询出来的表格啊!!
- 使用CXGRID中有点新的问题,只有一列的CXGRID中新增一行内容时要回车后才能取得这行的内容,还有如新增一行不输入,什么也不操作去取得这
---------------------------------
...哇哈哈哈 CSDN's forum Explorer
虽然已经NILl了..可是下面怎么测都是not nil ???
if image1.Picture=nil then
showmessage('image1 picture is nil')
else showmessage('image1 picture is not nil');
这也可以??玩笑开大了吧??
procedure TImage.SetPicture(Value: TPicture);
begin
FPicture.Assign(Value);
end;
procedure TPicture.Assign(Source: TPersistent);
begin
if Source = nil then
SetGraphic(nil)
else if Source is TPicture then
SetGraphic(TPicture(Source).Graphic)
else if Source is TGraphic then
SetGraphic(TGraphic(Source))
else
inherited Assign(Source);
end;procedure TPicture.SetGraphic(Value: TGraphic);
var
NewGraphic: TGraphic;
begin
NewGraphic := nil;
if Value <> nil then
begin
NewGraphic := TGraphicClass(Value.ClassType).Create;
NewGraphic.Assign(Value);
NewGraphic.OnChange := Changed;
NewGraphic.OnProgress := Progress;
end;
try
FGraphic.Free; //<------ 此处释放了原来的图像
FGraphic := NewGraphic; //<--------- 使用新图像
Changed(Self);
except
NewGraphic.Free;
raise;
end;
end;