Previous Document Next Document

Object Model Reference : Classes : S : ShapeRange : Methods : ShapeRange.GetBoundingBox


ShapeRange.GetBoundingBox

Sub GetBoundingBox(x As Double, y As Double, Width As Double, Height As Double, [UseOutline As Boolean = False])

Description

Member of ShapeRange

The GetBoundingBox method returns the position of the lower-left corner of all the objects in a shape range, treating the range as a single shape. It also returns the total size of all the shapes in the range.

 

Parameter
Description
x
Specifies the x-coordinate of the lower-left corner
y
Specifies the y-coordinate of the lower-left corner
Width
Specifies the width of all objects
Height
Specifies the height of all objects
UseOutline
Specifies whether outlines are considered when calculating the size of the bounding box. If this value is set to True, shape outlines are taken into account when calculating the dimensions of the bounding box; otherwise, the shapes are treated as though they have no outline. This parameter is optional, and its default value is False.

VBA example

The following VBA 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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.