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.
Unfortunately, activation email could not send to your email. Please try again.

Diagram control and overview control

Thread ID:

Created:

Updated:

Platform:

Replies:

105357 Oct 4,2012 06:07 AM Oct 11,2012 08:16 AM Windows Forms 2
loading
Tags: Diagram
Klaudiusz Bryja
Asked On October 4, 2012 06:07 AM

Hi,

We use diagram and overview control in form. Is it possible to set diagram document (look at attached pictures, I mean white diagram element) centered in diagram control?
defaultNow.jpg - shows how we have this now
defaultNeeded.jpg - show what we want to achive, this white region shoud be centered and with marging about 50px.

The same issue we have with overview control. Is it possible to set overview control that red rectangle has document centered in it and with some margins (e.g. 10px). How to set red rectangle which is smaller than overview control - I attach overviewNeeded.jpg which shows exactly what I want to achive.


Best regards,
Klaudiusz


default_a7f1fe9f.zip

Klaudiusz Bryja
Replied On October 11, 2012 05:48 AM

Hi,

Any answers for us?

Best regards,
Klaudiusz

Amsath Ali M [Syncfusion]
Replied On October 11, 2012 08:16 AM

Hi klaudiusz,

 

Thanks for your interest in Syncfusion products.

 

 

1. We use diagram and overview control in form. Is it possible to set diagram document (look at attached pictures, I mean white diagram element) centered in diagram control?

We suggest you to use the diagram’s ‘ClientSize’, diagram.view’s ‘origin’ and diagram.Model’s ‘LogicalSize’ properties to position the diagram document in the center of the view.

 

Here is the code snippet:

[C#]

 

SizeF visibleViewSize = diagram1.Controller.ConvertToModelCoordinates(diagram1.ClientRectangle).Size;

            SizeF modelSize = diagram1.Model.LogicalSize;

            PointF diff = new PointF((visibleViewSize.Width - modelSize.Width)/2, (visibleViewSize.Height - modelSize.Height)/2);

            PointF origin = new PointF(diagram1.View.Origin.X - diff.X, diagram1.View.Origin.Y - diff.Y);

            diagram1.View.Origin = origin;

 

Here is the sample for your reference:

<a rel='nofollow' href='http://www.syncfusion.com/downloads/Support/DirectTrac/92627/F105357-567836514.zip'>F105357-569405468.zip</a>

 

2. Is it possible to set overview control that red rectangle has document centered in it and with some margins (e.g. 10px). How to set red rectangle which is smaller than overview control?

Currently, the overview control’s viewport handle’s position and size has been calculated based on the origin, size of the current view and Magnification of the diagram control. It is not feasible to change its position and size of the viewport handle externally because it changes the origin and magnification of the diagram control.

 

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;