Go to GoReading for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.

Is there an Image in the TImage Delphi Control?

106 8


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 thenbegin  ... 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

Source...

Leave A Reply

Your email address will not be published.