Previous Document Next Document
Shape.SetSizeEx

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

Member of Shape

The SetSizeEx method stretches a shape to the specified width and height, relative to the coordinates specified as the anchor point. The anchor point remains stationary when you stretch the shape, and it therefore represents the center of the distortion. If any of the parameters is omitted, the size is calculated based on the other dimension to maintain proportions.

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

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

The following code 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 2007 Corel Corporation. All rights reserved.