![]() |
![]() |
ShapeRange.GetBoundingBox
Sub GetBoundingBox(x As Double, y As Double, Width As Double, Height As Double, [UseOutline As Boolean = False])
Member of ShapeRange
The GetBoundingBox method returns the position of the lower-left corner of all of the objects in the range, treating the group of shapes as a single object. It also returns the total size of all of the objects in the range.
If the UseOutline parameter is True, any outlines of shapes are taken into account when calculating the dimensions of the bounding box. Otherwise, the shapes are treated as if they had no outline.
See also the PositionX, PositionY, SizeWidth, and SizeHeight properties, as well as the GetPosition, SetPosition, GetSize, SetSize, SetSizeEx, and Move methods.
The following code example creates a rectangle that surrounds an ellipse:
Sub Test() Dim s As Shape Dim sr As ShapeRange Dim x As Double, y As Double, w As Double, h As Double Set s = ActiveLayer.CreateEllipse(1, 2, 3, 4) ActiveDocument.ReferencePoint = cdrCenter Set sr = ActivePage.Shapes.All sr.GetBoundingBox x, y, w, h ActiveLayer.CreateRectangle2 x, y, w, y End Sub
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.