Object Model Reference : Classes : S : Shape : Properties : Shape.OriginalHeight |
Property OriginalHeight As Double
Member of Shape
The OriginalHeight property returns the height of a shape at creation, before any transformations were applied to it.
The OriginalHeight property returns a read-only value.
The following VBA example creates a rectangle that copies all the transformations of the currently selected shape.
Sub Test() |
Const g2rad As Double = 1.74532925199433E-02 |
Dim s As Shape, r As Shape |
Dim x As Double, y As Double |
Set s = ActiveShape |
If s Is Nothing Then |
MsgBox "Nothing selected. Please try again", vbCritical |
Exit Sub |
End If |
ActiveDocument.ReferencePoint = cdrCenter |
s.GetPosition x, y |
x = x - s.OriginalWidth / 2 |
y = y - s.OriginalHeight / 2 |
Set r = ActiveLayer.CreateRectangle2(x, y, s.OriginalWidth, s.OriginalHeight) |
r.Stretch s.AbsoluteHScale, s.AbsoluteVScale * Cos(s.AbsoluteSkew * g2rad) |
r.Skew s.AbsoluteSkew, 0 |
r.Rotate s.RotationAngle |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.