Diagram control and overview control
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
Any answers for us?
Best regards,
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
- 2 Replies
- 2 Participants
-
EN enova
- Oct 4, 2012 10:07 AM UTC
- Oct 11, 2012 12:16 PM UTC