I am using an imagelist with a label control, basically doing custom rolleover affect. However, if I use an imagelist and try and write the image to the label it keeps shrinking the image to 16×16, even when the image in the list is actually 21 high by 65 wide, why is this and how can I stop it, basically display image at its default size?
I am using an imagelist with a label control, basically doing custom rolleover affect.
Share
The problem comes from the ImageList. It has a property ImageSize that has a big impact on the List itself.
If you take a look at design time into the images of your ImageList, they will all show up their real width and height values. But by compile time the images will be stored within the list using the given ImageSize. So all images within a ImageList will be already stretched to the given size at runtime.
Attention: If you change the ImageSize at runtime all images will be removed from the list!
To solve your problem you have two possibilities:
Properties.Resources.MyPictureFile