Print Page | Close Window

Transparancy becomes black

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=2085
Printed Date: 29 September 2024 at 10:23pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Transparancy becomes black
Posted By: mweinberger
Subject: Transparancy becomes black
Date Posted: 06 April 2005 at 10:57pm
Hi all,

I'm using the command bar conrol with VB6. I'm using icons (256, 24x24) that I place in an ImageList. When I first add the icons to the ImageList and run my program all is fine, however on subsequent launches the icons in the ImageList corrupt themselves. What happens is that the transparent area becomes black. 24x24 is the most affected, whereas 32x32 appears to work fine. 16x16 takes longer. What's causing this problem and how do I fix it.

Thanks in advance,

Martin



Replies:
Posted By: gshawn
Date Posted: 06 April 2005 at 11:52pm

Hi,

I have experienced this exact same problem in the past. It is actually not a problem with the CommandBars control, but with the ImageList control. It has some quirks when dealing with multiple 256-color palette bitmaps. You will see the same problem if you use a TreeView or ListView control instead of a CommandBars control. Oftentimes, the problem only appears after you close the project is and re-open it.

The solution is to save your bitmaps as true-color bitmaps instead, even if the icons only use a few colors. Since the icons are small, they do not take much disk space anyway. After converting all your icons to 24-bit bitmaps, clear all of your ImageList icons (or delete the control) and then load each image again. Using true-color bitmaps will prevent images in the ImageList control from getting corrupted.

I hope this helps!



Posted By: mweinberger
Date Posted: 09 April 2005 at 1:51pm
Thanks gshawn! I'll give it a try. There was an MSDN article that stated to reinstall SP6 on VB6. It indicated that the problem is with different versions of the DLL. I was also using the ".Icons = " and the ".AddImageList = " properties. I got rid of the ".Icons = " property. These acts seems to have fixed the problem. At least for now. What you said makes perfect sense. Thansk!!!!!!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net