2.2.4.8.34 DataPlot::SetColorRGB

Description

Set the color of the dataplot (line, symbol) by the intensities of red, green, and blue colors.

Syntax

BOOL SetColorRGB( BYTE byRed, BYTE byGreen, BYTE byBlue, BOOL bRepaint = FALSE )

Parameters

byRed
[input] the intensity of red.
byGreen
[input] the intensity of green.
byBlue
[input] the intensity of blue.
bRepaint
[input] TRUE to cause graph repaint, FALSE not to repaint.

Return

return true for success; otherwise false.

Examples

EX1

void    DataPlot_SetColorRGB_ex1()
{
    Worksheet wks;
    wks.Create("origin");
    Dataset ds1(wks,0);
    Dataset ds2(wks,1);
    ds1.Data(1,20,1);
    ds2.Normal(20);
    GraphPage gp;
    gp.Create("origin");
    GraphLayer gl(gp.GetName(), 0);
    gl.AddPlot(wks);
    if(gl)
    {
        // Get the first data plot in the layer:
        DataPlot        dp = gl.DataPlots(0);
    
        // Set the color to green and repaint:
        dp.SetColorRGB(0x00, 0xFF, 0x00, TRUE);
    }
}

Remark

See Also

Header to Include

origin.h