Previous Document Next Document
Ellipse.SetCenterPosition

Sub SetCenterPosition(PositionX As Double, PositionY As Double)

Member of Ellipse

The SetCenterPosition method moves the ellipse so that its center is located at given coordinates. Using SetCenterPosition is equivalent to setting the values of both CenterX and CenterY properties at the same time.

Parameters
Description
PositionX
Sets the x-coordinate for the center of an ellipse, measured in document units
PositionY
Sets the y-coordinate for the center of an ellipse, measured in document units

The following code example increases the radius of the ellipse both horizontally and vertically by 2". Changing the radius of an ellipse causes its center to move. In order to preserve the center position of the ellipse, GetCenterPosition and SetCenterPosition are used.

Sub Test() 
 Dim x As Double, y As Double 
 Dim rx As Double, ry As Double 
 With ActiveShape.Ellipse 
  .GetCenterPosition x, y 
  .GetRadius rx, ry 
  .SetRadius rx + 2, ry + 2 
  .SetCenterPosition x, y 
 End With 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.