Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DrawNode event and overview window (Read 1108 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
DrawNode event and overview window
Feb 28th, 2013 at 11:21pm
Print Post  
Is it possible to determine, inside of the DrawNode event, if the node is being drawn for an Overview window or a Diagram?

The problem is that we do not want to do all of the rendering we do on the Diagram inside of the Overview, for every visible node, because of speed issues on large diagrams.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DrawNode event and overview window
Reply #1 - Mar 1st, 2013 at 8:24am
Print Post  
It seems we should add a RenderOptions argument to DrawEventArgs to let you access overview's detail properties, such as DrawText and DrawImages. For the time being you could check the scale of current graphics transform, but it will also apply when drawing inside a DiagramView that has been zoomed out a lot:

Code
Select All
private void diagram_DrawNode(object sender, DrawNodeEventArgs e)
{
	var measure = new SizeF(1, 1);
	measure = Utilities.DocToDeviceF(e.Graphics, measure);
	var scale = measure.Width;
	if (scale > 0.2)
		e.Graphics.FillRectangle(Brushes.Red, e.Bounds);
} 



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