Delphi Tips Trick

For Newbie

Iklan Responsive Atas

LightBlog
Responsive Ads Here

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;

No comments: