Print Page | Close Window

Report Control: Icons in compiled program

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=2370
Printed Date: 16 November 2024 at 3:34pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control: Icons in compiled program
Posted By: nighthawk
Subject: Report Control: Icons in compiled program
Date Posted: 13 June 2005 at 5:47am
I'm using an standard ImageList object to store 16x16 icons.  I use the following line to connect the ImageList to the report control:

ReportControl.SetImageList ilst16x16

When I run the program in the VB6 IDE, the icons in the report control display correctly.  When I compile the program and run the built EXE, the icons in the report control are displayed with a thick black border around the image portion of the icon. 

Does anyone know what might be going on here? 



Replies:
Posted By: SuperMario
Date Posted: 13 June 2005 at 7:26am
I would suggest trying to use the ImageManager (ReportControl.Icons),.


Posted By: nighthawk
Date Posted: 13 June 2005 at 8:42pm
I just spent all day trying to get the ReportControl to use icons from an ImageManager.  The results are very inconsistant.  I use an ImageManager control to display icons in my CommandBar objects and it works fine.  When I connect the same ImageManager control to a ReportControl, the icons either don't show up at all, or will only show up after I start clicking around in the window.  Also, in the compiled version of the program, the ReportControls are completely unresponsive to mouse clicks.

I looked through the sample programs but it doesn't appear that any of them use a ReportControl with an ImageManager.  They all use the standard ImageList so I can't easily tell whether I am doing something wrong.

Looking back at my original implimentation, my icons use more than 256 colors so it may be that the ReportControl renders them correctly in the IDE but in the compiled program, the color depth is being reduced to 256 causing the edge of the image to go from a gray shadow to a black shadow.

Is this a possiblity and is there anything I can do about it?


Posted By: SuperMario
Date Posted: 13 June 2005 at 10:33pm
Look at the Outlook 2003 Sample (VB6) or the ReportSample (C# 9.70).  And the ReportControl can handle images with much more color that 256, you can even add 32-bit Alpha icons.


Posted By: nighthawk
Date Posted: 13 June 2005 at 11:42pm
I played around with the ImageManager a little more and got it to work with the ReportControl.  Apparently, the ReportColumn.Icon and ReportRecordItem.Icon requires the index of the icon in the ImageManager based on the order the icon was added.  Based on the documentation, I was using it like the CommandBarControl.IconID property which is based on the ID value assigned to the icon when it is added to the ImageManager.  I guess in some situations, the two could be the same but it isn't in mine.

Also, using the ImageManager does not fix my problem.  Here are partial screenshots of the ReportControl that illustrate what I am getting:


The icons in the left screenshot are how it looks in the IDE.  The right is how it looks when the program is compiled.  It appears the same whether I use the ImageManager or the ImageList.


Posted By: Oleg
Date Posted: 14 June 2005 at 5:14am

May be the problem in bitmap? Can you upload it to check?

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: nighthawk
Date Posted: 14 June 2005 at 5:30am
I'm using .ico files.  The same files are used for the CommandBar as well as the ReportControl.  The CommandBars display the icons correctly.  Here are some of the icons:

uploads/nighthawk/2005-06-14_052836_sample_icons.zip - 2005-06-14_052836_sample_icons.zip


Posted By: SuperMario
Date Posted: 15 June 2005 at 8:52am
I just used your icons in the ReportControl and they looked ok.  I think problem might be that you have 2 icons in each ICO file.  Both a 256 color and WinXP image.  Maybe you need to remove the 256 color image.


Posted By: nighthawk
Date Posted: 17 June 2005 at 3:28am
I tried removing the 256 color version but the result was an invalid icon file.  I tried removing the WinXP image but the result was a blurred icon on the table which wasn't consistent with the original 256 color version.  I also tried using bitmap files but the ReportControl became unresponsive.

After more experimenting, I realized that there was one thing I was doing different from the sample applications.  My program uses a lot of icon and image files so I put all of them in a single resource file.  I was loading the icons into the ImageList and ImageManager directly from the resource file using the built-in function LoadResPicture().  I added a step where the icon file is outputed to a temporary file and then read into the ImageList and ImageManager.  The icons now appear fine in both the IDE and compiled version of the program.

Something about loading the icons directly from the resource file causes the ReportControl to display them incorrectly in when the program is compiled.  None of the other CodeJock controls appear to have this problem.



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