okutil_get_col_by_ocolor

 

Description

Get details about a plot color

Syntax

BOOL okutil_get_col_by_ocolor( OQCOLOR oqColor, int nMainColIndex, int * pnModifiedColIndex, int * pnColType )

Parameters

oqColor
[input] 64bit OQCOLOR value
nMainColIndex
[input] data plot's worksheet Y( Z if 3D plot ) column index, only needed if pnModifiedColIndex is used, ignored otherwise
pnModifiedColIndex
[output] pointer to receive the color reference column index
pnColType
[output] pointer to receive the reference type, COLTYPE_COLOR_INDEX, etc

Return

return false if oqColor is for a single color type, return true if by point color type

Examples

EX1

//assume graph with a line plot or a scatter plot, or a line symbol plot
void pp()
{
    GraphLayer gl = Project.ActiveLayer();
    DataPlot dp(gl.DataPlots(0));    
    Tree tr;
    tr = dp.GetFormat(FPB_ALL, FOB_ALL, true, true);
    __int64 qColor;
    if(tr.Root.Line)
        qColor = tr.Root.Line.Color.nVal64;
    else if(tr.Root.Symbol)
        qColor = tr.Root.Symbol.EdgeColor.nVal64;
    else {
        out_str("plot type not having line nor symbol");
        return;
    }
    int nRefType = -1;
    if (okutil_get_col_by_ocolor(qColor, 0, NULL, &nRefType))
        printf("plot color by points, color linking type=%d\n", nRefType);
    else
        out_str("plot single color");    
}

Remark

See Also

okutil_get_ocolor_by_col

Header to Included

origin.h

Reference