For Newbie

Tuesday, 15 November 2011

Simple trick to check whether there is a TImage on the image or not (TImage = blank).



Function Declaration:
isTImageEmpty function (img: TImage): Boolean;
begin
   if img.Picture.Graphic <> nil then Result: = False else
     Result: = True;
end;

Example of implementation:
procedure TForm1.Button1Click (Sender: TObject);
begin
   isTImageEmpty if (image1) then ShowMessage ('No image') else
     ShowMessage ('There are picture');
end;

Share on Facebook
Share on Twitter
Share on Google+

Related : Simple trick to check whether there is a TImage on the image or not (TImage = blank).