Search code examples
delphidelphi-xe4

Delphi XE4 - TImage is not displayed at runtime


Note: In the original question I was in a hurry and wrongly assumed that the problem was related to VCL Styles, but at the end after some testing it seems to be related to the SynGdiPlus.pas, so I removed the original description.


The problem:

TImage correctly shows the image at designtime but not at runtime.

The cause:

Gdip.RegisterPictures;//initialize SynGdiPlus.pas from Synopse.info

My solution:

Removed the use of SynGdiPlus.pas and notified the author about the problem, use the built-in support for PNG files provided by VCL.


Solution

  • Your version of SynGdiPlus is clearly deprecated.

    The current revision has a NOTSYNPICTUREREGISTER condition, which is enabled by default:

    initialization
    {$ifndef NOTSYNPICTUREREGISTER}
      Gdip.RegisterPictures; // will initialize the Gdip library if necessary
    {$endif}
    

    Ensure you got the latest revision of the source code tree.