Zoom to Shape

Mar 18, 2015 at 4:57 PM
I like to do Zoom to Shape. Its possible?

I can't find any method or property to this. Any help?
Coordinator
Mar 19, 2015 at 8:54 AM
I'm not sure what you mean with "zoom to shape", but the display component provides the following zoom options:
  • ZoomLevel: Specifies the zoom in percentage. Has to be > 0.
  • ZoomWithMouseWheel: True means zooming by rotating the mouse wheel, False means zooming by pressing Ctrl and rotating the mouse wheel.
  • EnsureVisible: There are several overloads of this method. It brings the given shape, point or rectanlge into view. The overloaded version that accepts a rectangle will zoom out if the specified rectangle (diagram coordinates) would not fit into the current view rectangle.
In case you want to bring a certain shape into view so it fills up the whole space, you can zoom in and then use ScrollTo (or EnsureVisible).
Hope this helps.