The timage component determines whether there is any small picture problem, such as online or online .....

Source: Internet
Author: User
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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.