The timage component determines whether there are any small image problems, such as master improvement and online... VCL Component Development and Application
Http://www.delphi2007.net/DelphiVCL/html/delphi_20061220165852240.html
Example:
How can I determine if there are any images in image1 ??
If image1.picture. Graphic = nil then
Or
If image1.picture. Graphic. Empty then
There seems to be a conflict between the two, because I want to clear the image in a button first
Clear image button event:
Procedure tfrm_ckxs.myspeedbutton3click (Sender: tobject );
Begin
Image_zp.picture.graphic: = nil;
End;
Then, in another button event, determine whether image1 has images. The event is as follows:
Whether it is if image1.picture. Graphic = nil then
Or
If image1.picture. Graphic. Empty then
It seems that none of them are correct ?? Please give advice online
Anyone else
Procedure tform1.button1click (Sender: tobject );
Begin
Images. Picture. Graphic: = Nil
End;
Procedure tform1.button2click (Sender: tobject );
Begin
If images. Picture. Graphic <> nil then
Showmessage ('subscribe ');
End;
Delphi7 passed the test.
No
procedure tform1.button1click (Sender: tobject);
begin
If image1.picture. graphic = nil then
showmessage ('mei tu')
else
showmessage ('You tu');
end;
procedure tform1.button2click (Sender: tobject);
begin
image1.picture. assign (NiL);
end;
Procedure tform1.button1click (Sender: tobject );
Begin
If image1.picture. Graphic = nil then
Showmessage ('mei tu ')
Else
Showmessage ('You tu ');
End;
Procedure tform1.button2click (Sender: tobject );
Begin
Image1.picture. Graphic: = nil;
// Image1.picture. Assign (NiL );
End;
You can do the same. I don't know why you can't.
If image1.picture. Graphic = nil then
OK !!
Summary
Thank you!