Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Phosophersent graph

Solved!
Go to solution

I'm looking for some example code of how to use the phosphorescent graph shown in this demonstration:  http://www.ni.com/webcast/2863/en/

 

Sadly, there is no way to jump to a specific time in that video. If you press the forward button 18 times and then watch for a few several minutes, the phosphorescent graph is eventually demonstrated.

 

This looks very cool, but I haven't been able to figure out how to enable it.

 

Thanks.

 

Daniel

0 Kudos
Message 1 of 3
(4,204 Views)
Solution
Accepted by topic author DanielMcPherson

The WPF Feature Tour includes an example of the phosphor feature, although it does not include a separate code example. In brief, to enable phosphor you will need to 1) configure the graph to render in Raster, 2) set a PhosphorColorRamp, and 3) use a brush with a PhosphorMode set.

 

    <ni:Graph RenderMode="Raster">
        <ni:Graph.PhosphorColorRamp>
            <ni:FadeRamp FadeColor="Blue" Duration="20" DurationKind="Frames" />
        </ni:Graph.PhosphorColorRamp>
        <ni:Graph.Plots>
            <ni:​Plot>
                <ni:LinePlotRenderer>
                    <ni:LinePlotRenderer.Stroke>
                        <SolidColorBrush ni:Graph.PhosphorMode="Immediate" />
                    </ni:LinePlotRenderer.Stroke>
                </ni:LinePlotRenderer>
            </ni:​Plot>
        </ni:Graph.Plots>
    </ni:Graph>

 

You will also need to maintain a stable range, as resizing the bitmap will discard the previous phosphor state.

 

(Note that the phosphor effect being updated, so the syntax will be changing in the next release of Measurement Studio.)

~ Paul H
0 Kudos
Message 2 of 3
(4,195 Views)

Thanks! That worked for me.

 

Daniel

0 Kudos
Message 3 of 3
(4,174 Views)