Page 1 of 1

Custom colours (windows default).

Posted: Tue Apr 07, 2009 9:22 am
by 9530487
Hello,

I would like to be able to define the custom colours as listed in the standard windows colour picker dialog.

Image

In windows it is fairly easily to set these

COLORREF* ccolor = GetSavedCustomColors();
for (int i=0; i < 16; i++)
{
GetRValue(ccolor);
GetGValue(ccolor);
GetBValue(ccolor);
}

Is there any way to set these in TChart? On loading my app, I read previously stored colours from the registry and apply them, but the TChart colour picker has 16 black entries instead of the default windows ones.

Many thanks,

Tony.

Posted: Wed Apr 08, 2009 7:43 am
by yeray
Hi TonyVSUK,

If we understand well you have custom colors in an array or somewhere and you want to use them to change a series color (or pointer, line,... etc). If so, have you tried the RGB function? Could you please take a look at this topic where there is an example?

Posted: Wed Apr 08, 2009 8:02 am
by 9530487
No, that is not what I want to do.

If you access the properties for a chart, select the "Panel" tab, select "Background" tab, and now click "Color". This brings up the standard windows CColorDialog window, the custom colours here can be retrieved/defined using

COLORREF* ccolor = CColorDialog::GetSavedCustomColors();
for (int i=0; i < 16; i++)
{
//to get the colours
GetRValue(ccolor);
GetGValue(ccolor);
GetBValue(ccolor);

//to set the colours
ccolor = RGB(rCol,gCol,bCol);
}

I have some GUI development software, and elsewhere the user can define their own custom colours (I save them on a project by project basis). Ideally I could set them for the TChart elements as well so a user has a fixed set of custom colours available across the whole project they are working on.

I hope this makes sense.

Tony.

Posted: Wed Apr 08, 2009 1:44 pm
by yeray
Hi Tony,

I understand that you would like to add your custom color to the "custom colors list" of the color dialog. I've added it to the wish list to be implemented in further releases because I'm afraid it's not possible right now (TV52014070).

Posted: Wed Apr 08, 2009 1:46 pm
by 9530487
ok, thanks.

Tony.