Search
Diagram.ZoomToRect Method (Rect, Boolean)
See Also
 





Zooms and scrolls the view to fit the specified document rectangle in the Diagram's visible area.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public void ZoomToRect (
    Rect rect,
    bool centered
)

Visual Basic  Copy Code

Public Sub ZoomToRect( _
    rect As Rect, _
    centered As Boolean _
)

 Parameters

rect
A Rect instance specifying the diagram region that should be displayed.
centered
true to center the specified region in the viewport; otherwise, false.

 Remarks

The scroll position and zoom factor of the view are set so the specified rectangular area of the document is entirely visible in the diagram's client area. If the aspect ratio of the specified rectangle is different than the one of the viewport, the rectangle can be optionally centered in the available space as set through the boolean argument.

This method works correctly only if the Diagram is placed inside a ScrollViewer or Ruler.

 See Also