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
close icon

Diagram control and overview control

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

2 Replies

EN enova October 11, 2012 09:48 AM UTC

Hi,

Any answers for us?

Best regards,
Klaudiusz


AA Amsath Ali M Syncfusion Team October 11, 2012 12:16 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon