Groups | Blog | Home
all groups > dotnet drawing api > october 2006 >

dotnet drawing api : Blue border on images TreeView


ms NO[at]SPAM ecsit.nl
10/16/2006 2:14:32 AM
Hello,

I created a TreeView in C#.NET.
The treeview has an imagelist with some images for the Nodes. The
ColorDepth of the ImageList is: Depth32Bit.

But sometimes when I click a node, the images got an blue background
and/or border color. How can I prevent this? And what is the problem
that make this problem happen?

Hope somebody can help me.

GrtZ
Martijn
Bob Powell [MVP]
10/17/2006 10:25:19 PM
Are the images on a black or cyan background? Have you made images from
scaled bitmaps? Have you provided images for each of the supported sizes?


--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



[quoted text, click to view]

Michael C
10/18/2006 10:27:00 PM
[quoted text, click to view]

I've got the same issue with the toolbar. I can load up a 32bpp ARGB bitmap
and display it on the toolbar. The transparent areas are blue. The more
transparent they are the more blue they become, except the completely
transparent areas are transparent. It's as if the toolbar paints onto a blue
bitmap and then paints that onto itself. I haven't solved this so far so if
you come up with a solution please post it. I've confirmed that the images
have the correct transparancy because when I paint them direct on a form
they come out as expected.

Michael

Michael C
10/19/2006 12:00:00 AM
[quoted text, click to view]

I found a partial solution. The imagelist seams to screw with images so I've
included them all as resources as pngs. I then load up each bitmap and
remove the alpha blending by painting it onto a bitmap with a
SystemColors.Control color. Then add this bitmap to the listview. On
syscolorchange message I should probably repeat the entire process but
haven't got that far yet.

Michael

Michael C
10/19/2006 12:00:00 AM
[quoted text, click to view]

I've changed this method slightly, now I convert any pixels with a partial
alpha to a solid color and any pixels which are completely transparent I
leave as is. The way I was doing it previously was showing a square box
around icon when the user moved the mouse over the button.

This is not a perfect solution because when the user mouses over the buttons
the pixels should be blended with a slightly lighter shade of gray but i'd
be pretty suprised if anyone could pick it. Certainly my apps looks 100%
better than it did before with solid icons.

Michael

AddThis Social Bookmark Button