Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to make dockable for node to loke as background (Read 1161 times)
Hamdy Ghanem
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 110
Location: Egypt
Joined: Mar 11th, 2009
How to make dockable for node to loke as background
Feb 16th, 2012 at 8:37am
Print Post  
Hi there
I need to but a node as background (locked) it has an image
how to make it like dockable so if i resize the owner control of diagram view stretched to fill all space
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to make dockable for node to loke as background
Reply #1 - Feb 16th, 2012 at 2:39pm
Print Post  
Hi,

If you need to show that image in the part of the diagram that's visible in the view regardless of scroll position, it is best to do that from the DrawBackground event handler:

Code
Select All
private Image backImage = Bitmap.FromFile(@"...");
private void diagram_DrawBackground(object sender, DiagramEventArgs e)
{
	RectangleF viewport = diagramView.ClientToDoc(diagramView.ClientRectangle);
	Utilities.DrawImage(e.Graphics, backImage, viewport, ImageAlign.Fit);
} 



If for some reason you must use a node, handle the ScrollChanged and ZoomChanged events and set the node's Bounds to the viewport rectangle as calculated above.

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