Jump to content
CB2021

How to select image size from VirtualImageList

Recommended Posts

I am using the VirtualImageList which shows I have access to images 16x16, 24x24, 32x32 and 48x48.  The picture below shows a TSpeedButton with the size Width=120 and Height=120. The image from the VirtualImageList is always 16x16. I would like to select the largest image that will fit in the button, in this case 48x48. How do select the image size to use? Can the image size be adjusted automatically? 

 

SpeedButton.png

Share this post


Link to post

The TVirtualImageList can only hold images of one size, which it retrieves from a TImageCollection. That works even if the requested size is not available in the collection. In that case one image is scaled to the requested size.


To have multiple sizes simultaneously you need separate TVirtualImageList instances.

 

If you need only one size, just set the TVirtualImageList to that size.

  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×