Previous Document Next Document

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


Shape.GetBoundingBox

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

Description

Member of Shape

The GetBoundingBox method returns the size of a shape and the position of its lower-left corner.

Parameter
Description
x
Specifies the horizontal, or x-, coordinate of the lower-left corner. This value is measured in document units.
y
Specifies the vertical, or y-, coordinate of the lower-left corner. This value is measured in document units.
Width
Specifies the horizontal length, measured in document units
Height
Specifies the vertical length, measured in document units
UseOutline
Specifies whether the outline is included in any measurements. This parameter is optional, and its default value is False.

 
If the UseOutline parameter is set to True, then the outline width and shape are accounted for when calculating the bounding-box dimensions. Otherwise, the shape is treated as if it has no outline.
VBA example

The following VBA example creates a rectangle around each shape on the active page.

Sub Test()
 Dim s As Shape
 Dim x As Double, y As Double, w As Double, h As Double
 ActiveDocument.ReferencePoint = cdrBottomLeft
 For Each s In ActivePage.Shapes
  s.GetBoundingBox x, y, w, h
  ActiveLayer.CreateRectangle2 x, y, s.SizeWidth, s.SizeHeight
 Next s
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.