I have a TDatamodule
that has a TImageCollection
(70 images) and 3 TVirtualImageList
s.
Its creation take a lot of time. The .dfm
file measures slightly over 400 kB.
I'd like to autocreate this datamodule because the images are used throughout the program.
But in the project source the Application.CreateForm(TDMImageStore, DMImageStore);
takes 7-8 seconds (inside/outside the IDE).
Creating the datamodule later only moves the problem in time.
I assume this is all main thread code, any attempts to make a splash screen with an animation therefore fail.
Is there a way to work around this, e.g. create the datamodule in the background?
On program start the user lands in a menu screen which does not need the images yet, so there is some time for this (e.g. no actions requiring the images until a 'created' flag is set).
Win32 program in Delphi 10.4 Sydney.
(If there is no real way around this I can fall back on a static splash screen with an image.)