Object Model Reference : Classes : S : Shape : Methods : 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 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.
|
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 |
Copyright 2013 Corel Corporation. All rights reserved.