ChartDirector 7.1 (.NET Edition)

Chart.CColor


Usage

[C#]public static int CColor(System.Drawing.Color color);
[VB]Public Shared Function CColor(color As System.Drawing.Color) As Integer

Description

Converts a .NET System.Drawing.Color object to a ChartDirector color.

ChartDirector represents ARGB colors using a web and HTML compatible format. For example, red is represented as FF0000, the same as used in HTML.

On the other hand, the .NET System.Drawing.Color represents ARGB color using a different method. For example, the red color is FFFF0000 (obtained using Color.ToArgb).

In using ChartDirector, it is recommended to simply enter color using HTML compatible format, that is, using FF0000 as red. If .NET System.Drawing.Color is used, it needs to be converted to HTML compatible format. The formula in C# is:

color.ToArgb() ^ unchecked((int)0xff000000)

where "color" represents the .NET System.Drawing.Color color to be converted.

To make the formula simpler, ChartDirector provides the CColor function that translates a .NET System.Drawing.Color object to the HTML compatible ARGB color.

Arguments

ArgumentDefaultDescription
color(Mandatory)A .NET System.Drawing.Color object.

Return Value

A ChartDirector color.