Tuesday, 15 November 2011
Home »
Tips and Trick Delphi
» Simple trick to check whether there is a TImage on the image or not (TImage = blank).
Simple trick to check whether there is a TImage on the image or not (TImage = blank).
To Share | 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;
No comments:
Post a Comment