OK, so there were some performance issues with the app..
Disk caching...
Firstly, set this which works better where filenames are closely matched:
DiskCacheAlgorithm := -$00008004;
Secondly, you need to use a unique folder for your caching, e.g.
imageListG4.DiskCache.Folder := 'D:\emotetest\cache1';
imageListG2.DiskCache.Folder := 'D:\emotetest\cache2';
imageListG1.DiskCache.Folder := 'D:\emotetest\cache3';
In my testing that gives very good performance (after the initial caching).
Actual vs on-demand filling...
You are filling the content at startup, so ensure that you do not discard any images just because they are not visible:
imageListG4.MaintainInvisibleImages := -1;
imageListG2.MaintainInvisibleImages := -1;
imageListG1.MaintainInvisibleImages := -1;
imageListG4.StoreType := ietThumb;
imageListG2.StoreType := ietThumb;
imageListG1.StoreType := ietThumb;
Your Threaded fill...
You use a thread to fill the content, which is unnecessary as ImageEn will do that for you.
If you are using disk caching, you will get much better responsiveness by just performing a regular fill...
procedure TForm1.PopulateImages();
var
files: TStringDynArray;
filename: string;
begin
imageListG4.StoreType := ietThumb;
imageListG2.StoreType := ietThumb;
imageListG1.StoreType := ietThumb;
imageListG4.MaintainInvisibleImages := -1;
imageListG2.MaintainInvisibleImages := -1;
imageListG1.MaintainInvisibleImages := -1;
imageListG4.LockPaint;
imageListG2.LockPaint;
imageListG1.LockPaint;
try
files := TDirectory.GetFiles(FEmoteFolder, '*.png', TSearchOption.soAllDirectories);
for filename in files do
begin
if pos('.1.0.png', filename) > 0 then
imageListG1.AppendImage(filename);
if pos('.2.0.png', filename) > 0 then
imageListG2.AppendImage(filename);
if pos('.3.0.png', filename) > 0 then
imageListG4.AppendImage(filename);
end;
finally
imageListG4.SelectImage(0);
imageListG4.UnlockPaint;
imageListG2.UnlockPaint;
imageListG1.UnlockPaint;
end;
end;
But I prefer loading on demand...
...
files := TDirectory.GetFiles(FEmoteFolder, '*.png', TSearchOption.soAllDirectories);
for filename in files do
begin
if pos('.1.0.png', filename) > 0 then
imageListG1.AppendImage(filename + IEM_Path_Index_Delimiter + '[0]' );
if pos('.2.0.png', filename) > 0 then
imageListG2.AppendImage(filename + IEM_Path_Index_Delimiter + '[0]' );
if pos('.3.0.png', filename) > 0 then
imageListG4.AppendImage(filename + IEM_Path_Index_Delimiter + '[0]' );
end;
...
Also try the demo:
\Demos\Multi\MViewPerformance\Performance.dpr
Nigel
Xequte Software
www.imageen.com