Previous Document Next Document

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


Shape.SetSizeEx

Sub SetSizeEx(CenterX As Double, CenterY As Double, [Width As Double], [Height As Double])

Description

Member of Shape

The SetSizeEx method stretches a shape to a specified width and height, relative to the coordinates specified as the anchor point. The anchor point remains stationary, and it therefore represents the center of the distortion.

 
Omitting a parameter calculates the size to maintain the proportions of the shape.

 
See also the Shape.SetBoundingBox method, as well as the Shape.SizeWidth and Shape.SizeHeight properties.

Parameter
Description
CenterX
Specifies the x-coordinate of the anchor point
CenterY
Specifies the y-coordinate of the anchor point
Width
Specifies the horizontal measurement, in document units. This parameter is optional, and its default value is 0.
Height
Specifies the vertical measurement, in document units. This parameter is optional, and its default value is 0.

VBA example

The following VBA example stretches all shapes on the active layer proportionally so that their horizontal size is 2".

Sub Test()
 Dim x As Double, y As Double
 Dim sr As ShapeRange
 Set sr = ActiveLayer.Shapes.All
 If sr.Count > 0 Then
  ActiveDocument.ReferencePoint = cdrCenter
  sr.GetPosition x, y
  sr.SetSizeEx x, y, 2
 End If
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.