LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I change my plot color?

I use ActiveX cwgraph von NI to plot a graph and I�d like to choose the color of my plot. When I use a LW/CVI Numeric-Color, I don�t have the right color (see code below) :

long color;
GetCtrlVal(pnl,ctrl,&color);
CWUIControlsLib_CWPlotSetLineColor (plotYHandle, NULL, color);

Can somebody help me???

Thank you

Alex
0 Kudos
Message 1 of 3
(3,238 Views)
Looks like the control is returning the color in the format BGR instead of RBD integer that the CVI function returns. You can find this out by making the plot trace color blue, and using the CWUIControlsLib_CWPlotGetLineColor function to return the color value. Then compare this color value with the value returned by MakeColor (255, 0, 0).
To correct this, you might need to do some byte swapping before you set the color of the trace on cwgraph

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,238 Views)
I found this out.
Thanks for your help
Alex
0 Kudos
Message 3 of 3
(3,238 Views)