1

How to revert to default design-time assigned picture of TImage component in Delphi XE+?

1 Answers1

3

The control does not keep track of any previous images. So, you will need to do one of the following:

  1. Find a way to get hold of the image from the .dfm file when you need to revert.
  2. Make a note of the original image when the form is created, and restore that when you need to revert.

Option 1 is very messy, I do not recommend it. So, I suggest you go for option 2.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • 1
    A highly inefficient but easy implementation of 1 is to create a dummy form of the same class and assign the picture before freeing the dummy form. – Sertac Akyuz Dec 03 '14 at 16:13