ToolBar and ImageList interaction causing icon issue

Bars for Windows Forms Forum

Posted 18 years ago by Marianne
Avatar
This is a weird one. If I take a standard imagelist control and populate it with alpha-blended (32-bit) PNG icons everything is fine. I can create treeviews and other standard Windows Forms controls and have them make use of the images from the imagelist without a problem.

However, as soon as I add a ToolBarManager and assign it this image list and rebuild the project, all of the images in the image list have now lost their alpha blending and are only 24-bit icons now.

I had originally opened a trouble ticket with MS thinking it was related exclusively to the imagelist control but I couldn't reproduce the problem in any other application unless I added a UIStudio toolbar and assigned the imagelist to it (I then created a few buttons and assigned them an index) and rebuilt the solution.

Can you verify this?

------------------------------- Marianne

Comments (5)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I took a Form, added some 32-bit images to an ImageList (also set the ImageList so it can accept 32-bit images first), added some Buttons, referenced the ImageList and the images. They displayed fine.

Then I added a BarManager and referenced the ImageList. I added a dockable toolbar, added a command that used a 32-bit image, and made a link for it. I ran the program, all the images display fine.

I looked at our Bar code and we only reference the ImageList via a get/set property. Pretty standard stuff. Then when getting images, we use the indexer on the ImageList.Images property. Other than that we don't really do anything with it. So I don't think the problem could be anything caused by us.


Actipro Software Support

Posted 18 years ago by Marianne
Avatar
So how do you recommend that I troubleshoot the problem? I don't think I can tell Microsoft "The problem only occurs when I add in a 3rd party control--but they've assured me it's not their issue." I don't think that will fly. So given the fact that it only occurs when I add in a UIStudio toolbar what would be the best way to diagnose the problem?

------------------------------- Marianne

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I'm not sure what is best to do. I just tried again and even added a standalone ToolBar, hooked it up to the BarManager, and added a command link with a 32-bit image in an ImageList. Still no problems.

I really don't see how our controls could possibly be affecting the ImageList persistence. I did a search again through all the Bar code and all our code does is keep a variable reference to it, provide that public ImageList property on BarManager, and then we access the Images collection for rendering. But we never change anything on it.

Are you positive you have your ImageList.ColorDepth set at Depth32Bit?

Are you using VS 2005? That's what I'm testing with.

There used to be issues with storing 32-bit images in ImageLists in VS 2002 where they would drop alpha. If you google it you'll see plenty of posts like this:
Post about ImageList


Actipro Software Support

Posted 18 years ago by Marianne
Avatar
Thanks for the reply. After playing with this for 2 days I've been able to reproduce the problem without a UIStudio control. And in fact, I can now recreate the problem at will. It is definitely a .NET Framework issue and completely unrelated to UIStudio. Thanks again for the assistance.

------------------------------- Marianne

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Glad to help... please let us know if you find a resolution to it. Things like this that should work can certainly be very frustrating.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.