Blue icon background??

Jaco

Regular
Joined
Mar 10, 2004
Messages
63
What would cause icons that appear normal in VB6 suddenly have a dark blue background in VB.NET ?

The icons appear normal when examined in any image viewer (VS, Paint, etc.), but when used in an ActiveX control (which can't be upgraded yet) referenced from a VB.NET 2005 project they have an annoying blue background (same in VB.NET 2003 by the way).
 
How are the icons stored? As resources? As files? The problem could be a marshalling problem, or a conversion issue. Have you tried putting the icons in .NET controls?
 
Thanks for your help.

They are icons that are stored in a .NET ImageList. They are then associated with a Farpoint Spread 3 control to display in various cells (I can't upgrade yet to the newer spread since it's too much work for phase I of the upgrade to .NET). Strangely enough the ActiveX control property expects a System.Drawing.Image even though it's an ActiveX control (or is that strange??).

The icons do appear normal when associated with .NET controls such as the toolstrip.
 
It should expect a System.Drawing.Image. .Net takes care of all the marshalling, i.e. converting ActiveX types to and from .Net types. But this does sound like an interop issue. Sometimes .Net seems to have some issues with losing transparency data.

The files may be stored in .Net in an ARGB format, which ActiveX won't be able to support. If that is the case the Alpha data will simply be tossed out when the bitmap is sent to the ActiveX control. Try changing the ColorDepth property of the ImageList or loading from a different file format (i.e. GIF) if possible.
 
Thanks for your help.

I've decided to use bitmap images for this now and it works fine - these aren't quite as nice as the icons I was using, but it's fine.
 
Back
Top