In my manga viewer i try to load a large number of images (around 200), i try loading these images inside an anonymous thread and when the loading finishes i call a Thread.synchronize, this works fine, but in some cases i keep seeing some images not drawn on the form (I think they are loaded because i can see the information about the image), how can i solve this?
This issue only happens in multi thread so i decided to set the image visible to false and then at the end of the loading inside a Thread.synchronize turn the visible to true, i had hoped this would force some kind of refresh or redraw, but the problem i mentioned consists
for imageIndex := 0 to fileList.count – 1 do
filePath := fileList[imageIndex]
//Please note that mImageList is an array of FMX.Objects.TImage
//which was filled when the Form is created (I create 300 TImage
//at Form create and later i load the images to the bitmap when
//the user clicks on a new directory(Chapter)
mImageList[imageIndex].tagString := filePath;
mImageList[imageIndex].Scale := mImageScale;
mImageList[imageIndex].Visible := false;
for I := Low(mImageList) to High(mImageList) do
mImageList[I].Visible := true;
I expect that when i scroll down through the images loaded on the form, i can see them all and they all get drawn on the form properly.