Speed up image loading in TImage

200 Views Asked by At

How can I speed up image loading in TImage in Delphi 10.2?

I want to move a project from Delphi 7 to Delphi 10.2, but I'm having trouble loading files. In Delphi 10.2, images take much longer to load, and quality is lost.

In Delphi 7, it takes about 3 seconds. In Delphi 10.2, it takes 15 seconds.

From Delphi 7:

Image

From Delphi 10.2:

image

This is how I load the file:

IMG.Picture.LoadFromFile(ExtractFilePath(ParamStr(0)) + IMG.Hint);

I tried to connect GDIPAPI, GDIPOBJ, GDIPUTIL, but it did not work.

I finally tried to make a program snippet to demonstrate my problem: https://github.com/MrDimain/TestPicsSpeed.git

1

There are 1 best solutions below

0
On

Apparently the only solution is to use WICImage.LoadFromFile but loose some control like loading progress.