In Delphi I have an unknown number of image file names stored in a details table. These image files can be Bitmaps, Jpegs, PNGS and ICO files.
What's the paradigm / best practice to load and display those in a listview or a listbox on the go?
I take it I would somehow need to load those to a ImageList in OnBeforeScroll event of a master table and then assign that to a listview. Database components used are dbGO.
I only need to display thumbnails of predefined size (in a VCL program).
The simplest method is to use TPicture, since the loading of different graphic formats is already implemented and you do have to care about different image classes .
You have to ensure that the required units are included in the with uses so here e.g. jpeg, gifimg, and pngimg.
After loading with TPicture.LoadFromFile the images are painted, centered and scaled, on a prepared Bitmap with the dimensions of the Imagelist.
Last step is simply to call teh AddBitmap procedure with the Bitmap and nil for the mask.