Hello,
We asked you before, and now I ask you again, please post separate forum threads for different questions.
D wrote on Mar 27
th, 2020 at 4:38pm:
I would like to ask how can I change the picture to be displayed in the center of the diagram as soon as I open it?
Call this in your Window Loaded handler:
imageNode.Bounds = new Rect(diagram.Bounds.Width / 2 - imageNode.Bounds.Width / 2, diagram.Bounds.Height / 2 - imageNode.Bounds.Height / 2, imageNode.Bounds.Width, imageNode.Bounds.Height);
To make the diagram bounds as large as the viewport, use the following code. In addition to that, you may want to handle the Ruler SizeChanged event to readjust the bounds in case the window or the parent of the diagram are resized.
diagram.AutoResize = AutoResize.None;
diagram.Bounds = new Rect(0, 0, diagram.Viewport.Width, diagram.Viewport.Height);
D wrote on Mar 29
th, 2020 at 9:06am:
I would like to move the imageNode from (0,0) coordinates to (-50, -50) coordinates. Of course, the overlayNode will also follow the imageNode. What changes do I need to make?
To control any aspect of a ShapeNode location or size, modify its Bounds. In your case, set it to a Rect with the new location at -50, -50.
D wrote on Mar 29
th, 2020 at 9:06am:
What is the default coordinate unit of the diagram? I want to change the coordinate units of the diagram. How to modify it? After the modification, do I need to perform some related operations on the ruler to complete the entire coordinate change?
You can set the diagram measure unit via the Diagram.MeasureUnit property and the ruler unit via the Ruler.Unit property.
Regards,
Lyubo
MindFusion