4
votes

Is there a limit as to how many bitmaps can be stored inside a TImageList?

By limit I mean the amount of bitmaps it can hold, and or the memory size of the Image List.

Thanks.

2
thanks Frederik and LeleDumbo, I was using a TImageList which can grow in size rather quickly and was not sure if there would be any problems. The images are 16x16 in size so I guess I need not worry about it too much.user741875
You could write a test program to load .bmp images into one in a loop and see where it fails. Your question is hard to pin down because you don't even specify the order of magnitude. Certainly there IS a limit, but whether it's a practical or theoretical limit, depends on how many you're really going to put in there, and what your app needs to do with it later.Chris Thornton

2 Answers

6
votes

Internally the image list is implemented by Windows to store all images in one big bitmap. Your display device driver probably has a maximum bitmap size, and this limits the number of images you can put in an image list. Fortunately this limit has gone way up since Windows Vista. Anyway, you'll find that the limit is device-dependent.

0
votes

AFAIK no, but technically it's 2GB because the type of the index (LongInt, Integer actually, but Integer is mapped to LongInt anyway).