views:

351

answers:

2

Hi, I have a toolbar in a VB6 editor program which has a 24*24 icons in 24bits color. I put in the photos in a res. resource file and load them into the program via loadImage.

the problem is i can see the icon quality looks good running in debug mode but when i compile the program into an exe, there's a severe degradation going on.

I heard from my senior that there's something inside the visual studio which will automatically decrease the quality of the image inside.

Is this true? and if not, what is happening here? And more importantly, how do i work around this?

thanks!!

+1  A: 

So are you adding icons to your resource file or bitmaps? I do remember VB reducing a custom cursor to monochrome during runtime. I did a quick test app and added some bit maps to a resource file, then used Command1.Picture = LoadResPicture(101, vbResBitmap) to load the picture into a command button on a toolbar and they looked as good in debug or as an exe. If that isn't a solution for you or is way off base, if you can add some more detail I will look at it some more.

Beaner
@Beaner, i'm using a resource file which i will load into the system during runtime via a imagelist to show the icons as 24*24 custom size icons in the toolbar.
melaos
I tried that and I can see what you mean. It looks like the toolbar only supports 16bit color. I found a C++ article for creating a toolbar to support 24 bit color that you may be able to adapt, but I think the easiest thing to do is just reduce the color depth of the images you are loading to 16bit.
Beaner
sorry, forgot the link. Full-Featured 24-bit Color Toolbar: http://www.codeguru.com/cpp/controls/toolbar/article.php/c2537/
Beaner
Seems to be working here, but I'm using an ImageList as the source. Also using the comctl32.ocx so that styles can be applied using a manifest to select CC6.
Bob Riemersma
+1  A: 

Yes, there is an issue with VB6, as it simply does not know a lot about high color images. I fought this battle long and hard and eventually found a fix.

The key to the whole problem is the ImageList control, so get a replacement one: http://www.vbaccelerator.com/home/VB/Code/Controls/ImageList/index.asp

Then get yourself a new toolbar and/or command bar that works with that imageList: http://www.vbaccelerator.com/home/VB/Code/Controls/Command_Bar/index.asp http://www.vbaccelerator.com/home/VB/Code/Controls/Toolbar/index.asp

With these tools you won't lose color fidelity.

AngryHacker
thanks, definitely save a lot of headache in trying to figure out who's the culprit here.
melaos