Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Box fill colors not correct (Read 6214 times)
Bas
YaBB Newbies
*
Offline



Posts: 36
Joined: Apr 14th, 2006
Box fill colors not correct
Apr 14th, 2006 at 8:33am
Print Post  
Hi,

I am using Delphi 2005 and FlowChartX 4.0.1. When I drop a new TFlowChart on my form, and set the BoxFillColor property to clTeal, a box is displayed with the correct color.

When I do the same thing with several other colors, for example clInactiveCaption, the box will always be displayed with a black color.

This goes for fsSolid, fsGradientH and fsGradientV modes.

The same goes for BoxFillColor2, when used as a gradient. The entire box is black.

I hope this can be fixed in a future version.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box fill colors not correct
Reply #1 - Apr 14th, 2006 at 12:12pm
Print Post  
Hi, We'll look into that next week.
  
Back to top
 
IP Logged
 
Bas
YaBB Newbies
*
Offline



Posts: 36
Joined: Apr 14th, 2006
Re: Box fill colors not correct
Reply #2 - Apr 16th, 2006 at 6:46am
Print Post  
Nice, thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box fill colors not correct
Reply #3 - Apr 21st, 2006 at 6:31am
Print Post  
Hi,

We have tried that with Delphi 6 and all these UI element colors seem to work fine. We don't have Delphi 2005 - could you email us a compiled .exe that displays a flowchart and a button, and upon clicking the button sets fc.BoxFillColor to clInactiveCaption. We will trace through the property setter and see exactly what value is passed to it.

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Bas
YaBB Newbies
*
Offline



Posts: 36
Joined: Apr 14th, 2006
Re: Box fill colors not correct
Reply #4 - Apr 21st, 2006 at 9:17am
Print Post  
I just sent you an email with a demo project, incl. source. One important thing I just noticed is that this bug only occurs in GDI+ mode. In classic everything works fine.

You can test this yourself by launching the Project1.exe, create a box in the Flowchart, and click the button to switch to GDI+ mode.

Hope this helps. If you need anything else please let me know.
  
Back to top
 
IP Logged
 
Bas
YaBB Newbies
*
Offline



Posts: 36
Joined: Apr 14th, 2006
Re: Box fill colors not correct
Reply #5 - Apr 25th, 2006 at 5:58am
Print Post  
Hi, were you able to reproduce this behaviour?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box fill colors not correct
Reply #6 - Apr 25th, 2006 at 7:55am
Print Post  
Yes, that constant seems to specify an index in the system color palette, and GDI+ cannot work with such indices directly. We will have to implement lookup for the RGB values of a color in the palette and use them instead of the OLE_COLOR index value.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Box fill colors not correct
Reply #7 - Apr 26th, 2006 at 1:54pm
Print Post  
Tough luck with that - the control already uses OleTranslateColor/GetSysColor APIs to get the RGB values for OLE_COLOR system palette indices, which are encoded as 0x800000xx where xx is the index. The UI-color constants in Delphi are in that form, but for some of them those APIs return an E_INVALIDARG error code. Our developers think Delphi probably extends the OLE_COLOR semantics with its own palette implementation, but unfortunately we don't know how to get the actual RGB values from an index in that case. Try getting the actual R/G/B values using some Delphi function and assign them to the BoxFillColor instead of directly assigning the TColor constant.

The problem also happens when using the classic drawing API.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint