1. Home
  2. Computing & Technology
  3. Delphi Programming

Is there an Image in the TImage Delphi Control?

By , About.com Guide

TImage.Empty?

The TImage control can be used to display a graphical image - Icon (ICO), Bitmap (BMP), Metafile (WMF), GIF, JPEG, etc. The Picture property (of TPicture type) specifies the image that appears on the image control. There are many ways to assign an image for the TImage component: a TPicture's method LoadFromFile can be used to read graphics from disk, or Assign method can be used to get the image from Clipboard, for example.

In most situations you assign an image for the TImage at design-time, by setting the Picture property using the Object Inspector.

If you want to clear the TImage (at run-time), you asign NIL to the Picture property.

Here's how to check if the TImage is "empty":

if Image1.Picture.Graphic.Empty then
begin
 ...
end;
Note: "Image1" is the name of the TImage control.

Delphi tips navigator:
» Add Console Input and Output for a GUI Delphi Application
« Copy RTF Text/Formatting From one TRichEdit to Another

More Delphi Programming Quick Tips
Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Using VCL Components
  5. TImage
  6. Is there an Image in the TImage Delphi Control?

©2009 About.com, a part of The New York Times Company.

All rights reserved.