--> Simple trick to check whether there is a TImage on the image or not (TImage = blank). | Delphi Tips Trick

For Newbie

Tuesday 15 November 2011

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

| Tuesday 15 November 2011


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;

Related Posts

No comments: