Group: Forum Members
Last Active: 11 Years Ago
Posts: 43,
Visits: 1
|
I have a chart that I need to refresh very often (for example every second). I noticed that if I have a large value of MinorTickCount ScaleConfigurator's property and MinorGridStyle is visible, this refresh makes the whole application working slowly. If I break all processes I see that the main thread has the following call stack:
[Managed to Native Transition] > System.Drawing.dll!System.Drawing.Graphics.DrawLine(System.Drawing.Pen pen, float x1, float y1, float x2, float y2) Line 1154 C# Nevron.Presentation.dll!Nevron.GraphicsCore.lI1II1ll.PaintLine(float x1 = 112.0, float y1 = 9.0, float x2 = 112.0, float y2 = -70.0) + 0x4a bytes Nevron.Chart.dll!Nevron.Chart.NBackWall.lI1llIIl1I(Nevron.Chart.NChartRenderingContext2D context = {Nevron.Chart.NChartRenderingContext2D}, Nevron.Chart.NAxis axis = {Nevron.Chart.NCartesianAxis}, Nevron.Chart.NGridLine l1ll111lIIl = {Nevron.Chart.NGridLine}) + 0x33b bytes Nevron.Chart.dll!Nevron.Chart.NBackWall.lI1lI1ll1I(Nevron.Chart.NChartRenderingContext2D context = {Nevron.Chart.NChartRenderingContext2D}, Nevron.Chart.NAxis axis = {Nevron.Chart.NCartesianAxis}) + 0x28a bytes Nevron.Chart.dll!Nevron.Chart.NBackWall.lI1llIIl11(Nevron.Chart.NChartRenderingContext2D context = {Nevron.Chart.NChartRenderingContext2D}) + 0xa9 bytes Nevron.Chart.dll!Nevron.Chart.NCartesianChart.lI1llIlI1I(Nevron.Chart.NChartRenderingContext2D context = {Nevron.Chart.NChartRenderingContext2D}) + 0x1d4 bytes Nevron.Chart.dll!Nevron.Chart.NChart.PreOrderPaint2D(Nevron.Chart.NChartRenderingContext2D context = {Nevron.Chart.NChartRenderingContext2D}) + 0x5a bytes Nevron.Chart.dll!Nevron.Chart.NCartesianChart.PreOrderPaint2D(Nevron.Chart.NChartRenderingContext2D context = {Nevron.Chart.NChartRenderingContext2D}) + 0x5e bytes Nevron.Chart.dll!Nevron.Chart.NContentPanel.RenderInternal(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x17f bytes Nevron.Chart.dll!Nevron.Chart.NPanel.RenderInternal(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0xdc bytes Nevron.Chart.dll!Nevron.Chart.NContentPanel.RenderInternal(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x1a4 bytes Nevron.Chart.dll!Nevron.Chart.NPanel.RenderInternal(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0xdc bytes Nevron.Chart.dll!Nevron.Chart.NContentPanel.RenderInternal(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x1a4 bytes Nevron.Chart.dll!Nevron.Chart.NRootPanel.RenderInternal(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}) + 0x9b bytes Nevron.Chart.dll!Nevron.Chart.NDocument.Paint(Nevron.Chart.NChartRenderingContext context = {Nevron.Chart.NChartRenderingContext2D}, bool l1ll111l11I = false, bool recalc = true) + 0x11e bytes Nevron.Chart.dll!Nevron.Chart.l1II11IlIl.PaintContent() + 0x3b bytes Nevron.Presentation.dll!Nevron.GraphicsCore.NBitmapGdiRenderSurface.Paint(object sender = {Nevron.Chart.WinForm.NChartControl}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}, Nevron.GraphicsCore.l1ll11Il1 contentPainter = {Nevron.Chart.l1II11IlIl}) + 0x7c bytes Nevron.Chart.dll!Nevron.Chart.WinForm.NControlView.Paint(object sender = {Nevron.Chart.WinForm.NChartControl}, System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) + 0x12e bytes Nevron.Chart.WinForm.dll!Nevron.Chart.WinForm.NChartControl.OnPaint(System.Windows.Forms.PaintEventArgs e = {ClipRectangle = {System.Drawing.Rectangle}}) + 0x3d bytes System.Windows.Forms.dll!System.Windows.Forms.Control.PaintWithErrorHandling(System.Windows.Forms.PaintEventArgs e, short layer) Line 9541 + 0xf bytes C# System.Windows.Forms.dll!System.Windows.Forms.Control.WmPaint(ref System.Windows.Forms.Message m) Line 13284 C# System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Line 13688 + 0xb bytes C# System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Line 14109 + 0xe bytes C# System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Line 14164 + 0xb bytes C# System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 15, System.IntPtr wparam, System.IntPtr lparam) Line 779 + 0xe bytes C#
I understand that painting with such settings needs a lot of time. My question: is it possible to repaint the chart in another thread? So the main thread would be free. Related question: is it possible to find out if the rendering is in process? I could call refresh not every second but one second after the previous repainting was finished.
|