We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Re-center and/or zoom a model within Diagram

I am using version 6.2 of the Diagram control in VB (Windows Forms version).

How can I automatically center a model within a diagram, so it is visible on-screen. Also, I would like to be able to auto-zoom so my entire model is visible at a glance (so I don't need to scroll to view other parts of the model).

Thanks


5 Replies

AD Administrator Syncfusion Team June 2, 2008 05:13 PM UTC

Hi Mark,

Are you looking for Diagram.View.FitDocument method ?

Regards,
Babu



MA Mark Attridge June 2, 2008 05:39 PM UTC

Thanks for the help, but this isn't quite what I'm looking for.

I don't need to resize the boundaries of the document/model, I simply need to ensure the model is centered and an appropriate zoom value is applied.

My guess I will have to do this programmatically in some way. However, since I am new to using this Diagram control, I was hoping there was some built-in functionality to handle portions of my request.



J. J.Nagarajan Syncfusion Team June 3, 2008 12:38 PM UTC

Hi Mark ,

How can I automatically center a model within a diagram:

Could you please provide some more details regarding your requirement. Do you want to bring a node outside of the view to the center of the diagram?

You can use Magnification property of diagram view to zoom values on a scale.

Me.diagram1.View.Magnification = 150F

Please let me know if you have any questions.

Thanks,
Nagaraj



MA Mark Attridge June 5, 2008 02:22 PM UTC

I would like to bring a specific node in the diagram into view programmatically. I'm looking for a similar feature as is found in the TreeViewAdv control within the TreeNodeAdv class "BringIntoView".



AD Administrator Syncfusion Team June 6, 2008 06:46 AM UTC

Hi Mark ,

You can change the origin of the view according to the location of the nodes in non viewable area in the diagram model. Please refer to the attached sample that demonstrates this completely. In this sample when you checkout the "ViewNode" checkbox, the diagram will automatically scroll down and you can see the Rectangle.

http://websamples.syncfusion.com/samples/Diagram.Windows/F74162/main.htm

Please refer to it and let me know if this helps.

Thanks,
Nagaraj


Loader.
Live Chat Icon For mobile
Up arrow icon