如何判断Image中是否包含图片?(50分)

  • 主题发起人 wang2855
  • 开始时间
W

wang2855

Unregistered / Unconfirmed
GUEST, unregistred user!
如何判断TImage中是否包含图片
,我用Assigned(Picture.BitMap),或者 Picture=nil都不行,请各位大侠帮帮小第,不甚感激
 
if image1.Picture.Graphic = nil then
showmessage('');
 
Picture的属性用的不对,
应该用.Picture.Graphic = nil 来判断。
当然,你还应当注意下TGraphic的Empty属性。这个是帮助里的内容,可以懂么
Use Empty to determine whether the graphic is bound to an image. Each descendant graphic object defines its own Get method to access the Empty property.
所以,应该如此
(Picture.Graphic = nil ) OR (Picture.Graphic.Empty )THEN ……
 
向上顶顶。似乎想不到其它法子
 
这个办法最可行!up
 
if image1.Picture.Bitmap.Empty then
Showmessage('没有图片');
 
接受答案了.
 
顶部