Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Loading cursors asynchronously in a Scattergraph

Hi to all,

I'm trying to load 10,000 xycursors in a scattergraph. I would like to do this asynchronously so that it looks like the graph is filling up bit by bit, without freezing the app (windows desktop exe). Any advice? I code in vb.net but if you have code in c# that can help as well. Thanks in advance! 

0 Kudos
Message 1 of 2
(1,950 Views)

UI frameworks like Windows Forms and WPF generally require all updates to happen on the UI thread. In general, creating 10,000 UI components is not going to perform well in any UI framework.

 

I would suggest something along the lines of this answer for a WPF question: using the Windows Forms custom drawing API to render the cursors, instead of creating thousands of cursor objects. (Unfortunately, I am not familiar with the Windows Forms custom drawing API, beyond knowing that it exists — perhaps BeforeDrawPlotArea or AfterDrawPlotArea would be the best event to use?)

 

Hope that helps!

~ Paul H
0 Kudos
Message 2 of 2
(1,920 Views)