![]() |
![]() |
ActiveView.ToFitShapeRange
Sub ToFitShapeRange(ShapeRange As ShapeRange)
The ToFitShapeRange method changes the active view to fit an entire collection of shape objects on the current page into the application window. The ToFitShapeRange method adjusts the zoom level of the page so that the specified shapes fill the current view in the application window.
The following code example creates a rectangle and circle on the current page, adds the rectangle and the circle to a shape range, and uses the ToFitShapeRange method to adjust the active view and zoom in so that the shapes in the shape range make up the entire view in CorelDRAW.
Sub ToFitShapeRange() Dim s As Shape Dim sr As New ShapeRange Set s = ActiveLayer.CreateEllipse2(5, 5, 2) sr.Add s 'Creates an ellipse and includes it in the defined range Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2) sr.Add s 'Creates a rectangle and includes it in the defined range ActiveWindow.ActiveView.ToFitShapeRange sr End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.