|
Function to convert Windows Color to CD color integer |
Posted by KeithB on Jun-19-2024 04:34 |
|
Is there a function to do this? or vice versa?
I am displaying a color map in a windows bitmap, so want to convert from one to the other. I can do it by hand, but was just wondering. |
Re: Function to convert Windows Color to CD color integer |
Posted by KeithB on Jun-19-2024 04:41 |
|
I thought I should be more clear. I have a colorscale for my windows bitmap and want to use the same colors for each bar in a histogram chart. (cool, huh?)
Just wondering if there was an existing function. |
Re: Function to convert Windows Color to CD color integer |
Posted by Peter Kwan on Jun-19-2024 09:11 |
|
Hi KeithB,
By "Windows Color", do you mean .NET Color (System.Drawing.Color)?
In brief, it .NET can support the color (which means the color can be expressed as a .NET color), then you can convert it using the ChartDirector .NET API Chart.CColor. See:
https://www.advsofteng.com/doc/cdnet.htm#Chart.CColor.htm
Best Regards
Peter Kwan |
Re: Function to convert Windows Color to CD color integer |
Posted by KeithB on Jun-19-2024 21:58 |
|
Yep, that's it!
Now to decide whether to use your function or keep my function I wrote that returns the CD color instead of the .Net Color! |
Re: Function to convert Windows Color to CD color integer |
Posted by KeithB on Jun-19-2024 21:58 |
|
Yep, that's it!
Now to decide whether to use your function or keep my function I wrote that returns the CD color instead of the .Net Color! |
|