05-17-2023 03:48 AM
Hello,
I have an IntensityGraph with millions of points and I want to move a vertical cursor smoothly (controlled by a slider) over the displayed data. However, the movement of the cursor is not smooth. I think this is due to the redrawing of the entire dataset for every change of the cursor position.
The slider only updates the values which get used at the next update cycle of the graph, which is every 80 ms.
Is it possible to just redraw the cursor at the new cursor position and leave the other parts of the graph unchanged?
What solutions are possible?
05-17-2023 09:30 AM
05-22-2023 04:41 AM
I hope i captured the relevant things in a simplified form:
Language C#:
myIntensityGraph = new IntensityGraph()
myIntensityGraph as child of WindowsFormsHost in WPF:
<WindowsFormsHost>
</WindowsFormsHost>
myIntensityGraph.ImmediateUpdates = false
myPlot = new IntensityPlot()
myIntensityGraph.Plots.Add(myPlot)
myCursor = new IntensityCursor()
myIntensityGraph.Cursors.Add(myCursor)
myImageData = new double[10000, 1500];
myPlot.Plot(myImageData,….)
until here everything works, but the following update is too slow and blocks the UI thread too long (the slider on the GUI which supplies the newValueX begins to jump around):
UpdateCursor()
{ //runs every 80ms
myCursor.XPosition = newValueX;
}
05-26-2023 08:04 AM
Does anyone have tips and tricks on how to handle cursor updates efficiently?