Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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).

  • Leaders
Posted
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?
[sIGPIC]e[/sIGPIC]
Posted

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.

  • Leaders
Posted

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.

[sIGPIC]e[/sIGPIC]
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...