Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Imagelist Brings In Image at Wrong Size

Status
Not open for further replies.

mjk9564

Programmer
Apr 23, 2003
64
US
I'm using VB.NET 2005 and am having troubles loading my images into my imagelist. Even though I set the size to 16x16 when I import the images they always come in as 32x32. The icons do have different sizes saved inside them and the only way I can get the 16x16 to show up is if I delete all larger sizes. I have deleted the imagelist and even set the size with Me.imgIcons.ImageSize = New System.Drawing.Size(16, 16) in the InitializeComponent() procedure before loading them. Now if I have loading the icons already they will be changed to 16x16 after I set the above statement. The problem with this is they are resized by VB which makes them grainy. Shouldn't it grab the right saved size in the icon?

Any help would be appreciated.
Thanks!
Matt
 
This is a shot in the dark, but it sounds like you might be using something like a listview to show your images and it is set to large icons. If that is the case set it's View to SmallIcon and it should use your 16x16 icon.

-I hate Microsoft!
-Forever and always forward.
 
The problem isn't displaying the images in 16x16 or any other size for that matter it is importing the images at the correct size. To see the problem open an imagelist and import an icon that has multiple sizes saved such as 16x16 and 32x32. When you import this image it ignores the size you have set in the imagesize property and instead imports the 32x32 size. I hope that makes sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top