Search code examples
delphitimage

Revert to design-time TImage picture


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


Solution

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