auk_ie
asked on
Icon in Imagelist
Hello
I put an ImageList on my windows form and added an icon to the images collection property via the designer. Now when I use this icon in my form, for some reason the icon has a heavy black outline around it, where did this come from? When I look at the .ico file in windows explorer its perfect no ugly outline just a crisp graphic. I've been trying to change the properties of the ImageList but no joy. Any ideas on how I can resolve this? How does windows explorer manage to display the same ico file buit without the ugly outlining. PS I really don't wat to start editing the icons in a graphics app.
I put an ImageList on my windows form and added an icon to the images collection property via the designer. Now when I use this icon in my form, for some reason the icon has a heavy black outline around it, where did this come from? When I look at the .ico file in windows explorer its perfect no ugly outline just a crisp graphic. I've been trying to change the properties of the ImageList but no joy. Any ideas on how I can resolve this? How does windows explorer manage to display the same ico file buit without the ugly outlining. PS I really don't wat to start editing the icons in a graphics app.
Check the size of the images on the imagelist. Maybe the image is deformed because it's smaller or larger
Can you told me which control used icon from ImageList?
I have try to display icon from my ImageList (same as your) in PictureBox and it display correctly.
If you got the heavy black outline around it, it maybe the size of control displaying the icon is larger then the icon size
I have try to display icon from my ImageList (same as your) in PictureBox and it display correctly.
If you got the heavy black outline around it, it maybe the size of control displaying the icon is larger then the icon size
ASKER
Hello I have a 16x16 pixel icon and have set the image list. This is what I done exactly, I extracted the trash can icon from shell32.dll and tried to put it on a toolbar button. but the shadow of the trash can shows up in jet black, rather than the nice faded shadow effect in windows explorer. This black shadow effect seems to happen to other icons aswell.
try setting the property ColorDepth of the ImageList to Depth32BIT
Hi auk_ie,
I've try same way as your solution, one toolbar, one button on toolbar
toolBar1.Buttons[0].ImageI ndex = 0;
toolBar1.Buttons[1].ImageI ndex = 1;
toolBar1.Buttons[2].ImageI ndex = 2;
toolBar1.ImageList = imageList1;
Where imageList1 contains 3 icons with size 16x16. Till working correctly, there is no black shadow effect. Or maybe you should try setting ColorDepth property of ImageList to Depth32BIT
I've try same way as your solution, one toolbar, one button on toolbar
toolBar1.Buttons[0].ImageI
toolBar1.Buttons[1].ImageI
toolBar1.Buttons[2].ImageI
toolBar1.ImageList = imageList1;
Where imageList1 contains 3 icons with size 16x16. Till working correctly, there is no black shadow effect. Or maybe you should try setting ColorDepth property of ImageList to Depth32BIT
ASKER
I set the ColorDepth property to Depth32BIT but thats still the same. It beats me why it works for you and not me
How did you extract the icon from shell32.dll?
Bob
Bob
ASKER
Using a tool called IconCool (they advertise it as Powerful Icon Library Manager and Icon Extractor) available from www.iconcool.com
What is the color depth of the source image?
Bob
Bob
ASKER
How can I tell?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.