Mega Code Archive

 
Categories / Delphi / Graphic
 

Is there an Image in the TImage Delphi Control

Title: Is there an Image in the TImage Delphi Control? 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.