GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoView Class / RescaleToFit Method
Example
In This Topic
    RescaleToFit Method
    In This Topic
    Change the DocScale and DocPosition properties so that all document objects are visible.
    Syntax
    public virtual void RescaleToFit()
    Remarks

    This calls ComputeDocumentBounds to determine the size and position of this view's document. If the document is very large, the LimitDocScale method might prevent the whole document from fitting. LimitDocPosition may similarly prevent the whole document from fitting.

    Calling this method will not necessarily cause the scroll bars to disappear, because the scroll bars normally show the extent of the document, which is normally greater than the extent of the actual objects in the document. This method does not modify the size and position of the view's document. Depending on your application, you may wish to shrink the size of the document in order to cause the scroll bars to disappear.

    The value of the new DocScale will not be larger than one. In other words, if the document is small and thus fits easily in the view, it will not be scaled up beyond normal to expand to fit the view.

    Example
    goView1.Document.Bounds = goView1.ComputeDocumentBounds();
    goView1.RescaleToFit();
    See Also