Home > other >  ImageList limited to 256x256 bitmaps
ImageList limited to 256x256 bitmaps

Time:08-08

I want to load two larger images (480x60) in a TImageList. The ImageList will be assigned to a custom control (custom button) that will read the two images.

However, the Width/height of TImageList has a cap at 256. I was not aware of that because I never loaded something else than icons in TImageList. enter image description here

Which would be the best/quick alternative (already present in Delphi11)?

CodePudding user response:

Solution 1:
Since I need only two images, I created two class TPngImage variables. At run time I need to call only once a procedure to load something in those images, then I am good to go.
Tested. Works. Uses less memory because of the shared image.

Solution 2:
Starting from the TVirtualImageList suggested by DelphiCoder. Use TImageCollection which supports large images.
Tested. Works.

  • Related