![]() |
![]() |
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.
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
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.