Treeview Icons distorted
-
I have a treeview and each node has an icon. At runtime, the icons are appearing with a blue border which makes result very ugly. I use the same imagelist for a listview on the same form and the icons are being rendered perfectly without the blue boarder. Is there something in the system settings or whatever settings that i need to change or be aware of to get rid of this problem? The Icon size is 16X16 (same for the original icon, imagelist setting and treeview icon size) and the color depth is 32bit (highest for my machine) Thanks for assisting.
-
I have a treeview and each node has an icon. At runtime, the icons are appearing with a blue border which makes result very ugly. I use the same imagelist for a listview on the same form and the icons are being rendered perfectly without the blue boarder. Is there something in the system settings or whatever settings that i need to change or be aware of to get rid of this problem? The Icon size is 16X16 (same for the original icon, imagelist setting and treeview icon size) and the color depth is 32bit (highest for my machine) Thanks for assisting.
Do your icons have a alpha channel?? I can't seem to duplicate your problem at all and that alpha is about the only thing I haven't tried.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Do your icons have a alpha channel?? I can't seem to duplicate your problem at all and that alpha is about the only thing I haven't tried.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Hi Dave, thanks for your efforts. The icons are standard windows shell32 icons, i actually get them from the system files. a weird thing happened yesterday, I duplicated the troublesome part of the system outside the application and it works well (icons are rendered well) but the moment i took the form back into the project, it behaved as before. Here are the 2 outputs side by side, the left one is the correct one running independently, on the right one after i add it to my windows project, with nothing changed. http://www.4shared.com/file/35005243/44721ad3/Distorted.html[^]
-
Hi Dave, thanks for your efforts. The icons are standard windows shell32 icons, i actually get them from the system files. a weird thing happened yesterday, I duplicated the troublesome part of the system outside the application and it works well (icons are rendered well) but the moment i took the form back into the project, it behaved as before. Here are the 2 outputs side by side, the left one is the correct one running independently, on the right one after i add it to my windows project, with nothing changed. http://www.4shared.com/file/35005243/44721ad3/Distorted.html[^]
OK. The problem isn't what I was thinking of. I still didn't come up with that problem either. Is the color depth on the bad machine 32-bit?? It almost looks like 32-bit icons being rendered in 16-bit color. I'd also try updating the video drivers on the bad machine too. Hmm...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
OK. The problem isn't what I was thinking of. I still didn't come up with that problem either. Is the color depth on the bad machine 32-bit?? It almost looks like 32-bit icons being rendered in 16-bit color. I'd also try updating the video drivers on the bad machine too. Hmm...
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007The shots were taken on same machine, running at the same time, i simply dragged the 2 windows side by side. I load the imagelist from the windows shell which has icons of size 32,32. the treeview is set to show a 16,16 icon size. the color depth is 32bits. (code and settings in both shots is exactly the same, the only difference is that the one in the right is wat my application is outputting and i desire wat's on the left.)
-
The shots were taken on same machine, running at the same time, i simply dragged the 2 windows side by side. I load the imagelist from the windows shell which has icons of size 32,32. the treeview is set to show a 16,16 icon size. the color depth is 32bits. (code and settings in both shots is exactly the same, the only difference is that the one in the right is wat my application is outputting and i desire wat's on the left.)
OK. I kind-of see what you're getting at now. Ummm...A bunch of questions come to mind. 1st, how to duplicate this "outside of your project". You said that you brought the form back into the project at it started to fail again. What dod you do here? Did you create a seperate project that did the same thing and it worked as expected?? How did you get the icons from the Shell?? Are they sitting on your drive in seperate files or as resources in your app?? Did you use an ImageList setup exactly the same between the two projects??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
OK. I kind-of see what you're getting at now. Ummm...A bunch of questions come to mind. 1st, how to duplicate this "outside of your project". You said that you brought the form back into the project at it started to fail again. What dod you do here? Did you create a seperate project that did the same thing and it worked as expected?? How did you get the icons from the Shell?? Are they sitting on your drive in seperate files or as resources in your app?? Did you use an ImageList setup exactly the same between the two projects??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007I created a separate project, form and controls then put the code in. After it worked well, i created a new form in my application, copied and pasted the controls and also the code. The code I used is basically the same as this one. http://www.codeguru.com/vb/gen/vb_misc/icons/article.php/c5597/[^]