Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ControlNode rendering in Window Forms vs WPF version (Read 3317 times)
stefski
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 31
Location: Norway
Joined: Jul 17th, 2009
ControlNode rendering in Window Forms vs WPF version
Jan 3rd, 2012 at 10:28am
Print Post  
Hi,

using Flowchart.NET we are seeing an artifact in relation to the rendering of overlapping ControlNodes:



With the two plot ControlNodes on this picture it seems like the FlowChart.NET "part" of the nodes are drawn first and then the controls inside the ControlNodes are drawn (when the Diagram control is finished with its drawing) - thus painting on top of the selection frames.

Here is how we expected it to look:



Is there anything we might do in our code to solve this issue, or is this a bug in the component?
Is the behaviour different in the WPF version - i.e. more along the lines of our expectations?
  

Kind regards

Steffen Skov
OLGA Application Architect
Schlumberger Information Solutions AS
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlNode rendering in Window Forms vs WPF version
Reply #1 - Jan 3rd, 2012 at 10:46am
Print Post  
Hi,

Windows Forms controls are rendered in their own windows, and the diagram control cannot draw over these windows. What you can do on your side is to draw these "custom plot" graphs inside DiagramNodes instead of using hosted controls. You have a few options:

- use a rectangular custom-drawn ShapeNode and handle the DrawNode event to plot the graph
- derive from DiagramNode and implement its Draw method
- create a graph Component and show the graphs inside CompositeNodes

In WpfDiagram hosted controls can freely mix with other elements in the diagram Z order since they are all part of the same WPF visual tree and are not rendered in separate windows.

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


I love YaBB 1G - SP1!

Posts: 31
Location: Norway
Joined: Jul 17th, 2009
Re: ControlNode rendering in Window Forms vs WPF version
Reply #2 - Jan 3rd, 2012 at 11:46am
Print Post  
Thank you, Stoyan,

the plot in this case is another third-party component, so if we were to implement your suggestions I think we would have to implement the plotting ourselves.

Anyway, your answer was very helpful, as we are thinking about moving to the WPF version, and this would (if I understand you correctly) be another point for doing that transition.
  

Kind regards

Steffen Skov
OLGA Application Architect
Schlumberger Information Solutions AS
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ControlNode rendering in Window Forms vs WPF version
Reply #3 - Jan 3rd, 2012 at 12:09pm
Print Post  
If that component can export bitmap images or provides a public OnPaint(Graphics) method, you can still use it to draw inside nodes. E.g. you could keep its instance as a member of your custom node class, and then implement DiagramNode.Draw through that member. Btw. our chart/graph control can do that and also lets you plot using custom functions (see the sine function sample at http://mindfusion.eu/gallery-masterchart.html).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint