04-23-2015 02:27 PM
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
Solved! Go to Solution.
04-23-2015 05:29 PM - edited 04-23-2015 05:38 PM
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.)
04-24-2015 10:43 AM
Thanks! That worked for me.
Daniel