Previous Document Next Document
Shape.OriginalHeight

Property OriginalHeight As Double

Member of Shape

The OriginalHeight property returns the height of a shape when it was created, before any transformations were applied to it.

The OriginalHeight property returns a read-only value.

The following code example creates a rectangle that copies all of 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.