• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1449
  • Last Modified:

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.
0
auk_ie
Asked:
auk_ie
  • 4
  • 3
  • 2
  • +1
1 Solution
 
dsaboCommented:
Check the size of the images on the imagelist. Maybe the image is deformed because it's smaller or larger
0
 
dunglaCommented:
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
0
 
auk_ieAuthor Commented:
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dsaboCommented:
try setting the property ColorDepth of the ImageList to Depth32BIT
0
 
dunglaCommented:
Hi auk_ie,

I've try same way as your solution, one toolbar, one button on toolbar

toolBar1.Buttons[0].ImageIndex = 0;
toolBar1.Buttons[1].ImageIndex = 1;
toolBar1.Buttons[2].ImageIndex = 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
0
 
auk_ieAuthor Commented:
I set the ColorDepth property to Depth32BIT but thats still the same. It beats me why it works for you and not me
0
 
Bob LearnedCommented:
How did you extract the icon from shell32.dll?

Bob
0
 
auk_ieAuthor Commented:
Using a tool called IconCool (they advertise it as Powerful Icon Library Manager and Icon Extractor) available from www.iconcool.com
0
 
Bob LearnedCommented:
What is the color depth of the source image?

Bob
0
 
auk_ieAuthor Commented:
How can I tell?
0
 
Bob LearnedCommented:
If you have Windows XP, the file properties (Summary tab) show the size and color depth.  If you don't, I am not quite sure how to find out.

Bob
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now