Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Intense Flicker When Using Control Nodes (Read 4616 times)
benm
YaBB Newbies
*
Offline


I <3 MindFusion

Posts: 32
Location: CA
Joined: Dec 10th, 2008
Intense Flicker When Using Control Nodes
Dec 10th, 2008 at 9:54am
Print Post  
Hello,

Forgive me if this has already been asked, but I was not able to find a solution on the forums. I am developing a project and so far I love FlowChart.Net but I am trying to use control nodes with a custom control I am also developing. When adding a few of these nodes and then panning the view, there are very ugly artifacts. Please take a quick look at the following screen capture video:



Any suggestions on how to improve this will be greatly appreciated. Also note that this does not occur when using the standard shape or table nodes.

Thanks!

-Ben
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Intense Flicker When Using Control Nodes
Reply #1 - Dec 10th, 2008 at 11:07am
Print Post  
Try handling the ScrollChanged event like this:

Code
Select All
private void diagramView_ScrollChanged(object sender, System.EventArgs e)
{
	diagramView.Refresh();

	foreach (DiagramNode node in diagram.Nodes)
	{
		ControlNode host = node as ControlNode;
		if (host != null)
			host.Control.Refresh();
	}
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
benm
YaBB Newbies
*
Offline


I <3 MindFusion

Posts: 32
Location: CA
Joined: Dec 10th, 2008
Re: Intense Flicker When Using Control Nodes
Reply #2 - Dec 10th, 2008 at 6:35pm
Print Post  
Hi Stoyan,

Yes this helps quite a bit although as expected, the scrolling is now very slow and jumpy, especially if more than 5 nodes are placed. I wonder if there is some sort of double-buffering technique I could use, or if this is just a limitation of the GDI and something like DirectX would be needed to render smoothly. Any thoughts on this?

Thanks,
Ben
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Intense Flicker When Using Control Nodes
Reply #3 - Dec 11th, 2008 at 6:07am
Print Post  
Hi Ben,

Unfortunately since every control in WinForms has its own window, it can't get much faster than that. From what I can see in the video, you could display your data using TableNodes that have some spanning rows and columns, instead of user controls. You could use the user control only as a more advanced in-place editor, by setting it from the CreateEditControl event handler.

Using custom controls as nodes works much better in WPF, so you might check the WPF version of Flowchart.NET:
https://mindfusion.eu/WpfDiagTrial.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
benm
YaBB Newbies
*
Offline


I <3 MindFusion

Posts: 32
Location: CA
Joined: Dec 10th, 2008
Re: Intense Flicker When Using Control Nodes
Reply #4 - Dec 11th, 2008 at 8:00am
Print Post  
Great, I think I will give that a try and I will post the results.
  
Back to top
WWW  
IP Logged
 
benm
YaBB Newbies
*
Offline


I <3 MindFusion

Posts: 32
Location: CA
Joined: Dec 10th, 2008
Re: Intense Flicker When Using Control Nodes
Reply #5 - Dec 30th, 2008 at 8:15am
Print Post  
Update:

I redesigned the application in WPF using the WpfDiagram control and the results are perfect!



Thanks,
Ben
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Intense Flicker When Using Control Nodes
Reply #6 - Dec 30th, 2008 at 8:31am
Print Post  
It looks great 8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint