Previous Document Next Document
Layer.CreateEllipse2

Function CreateEllipse2(CenterX As Double, CenterY As Double, Radius1 As Double, [Radius2 As Double], [StartAngle As Double = 90], [EndAngle As Double = 90], [Pie As Boolean = False]) As Shape

Member of Layer

The CreateEllipse2 method creates an ellipse using the coordinates of the shape’s center, the horizontal radius, and, if you want, the vertical radius.

Parameters
Description
CenterX
Defines the x-coordinate of the center point. The value is measured in document units.
CenterY
Defines the y-coordinate of the center point. The value is measured in document units.
Radius1
Defines the measurement from the x-coordinate of the center point to the circumference. The value is measured in document units.
Radius2
Defines the measurement from the y-coordinate of the center point to the circumference. The value is measured in document units.
This parameter is optional, and its default value is 0.
StartAngle
Defines the degree of an ellipse’s start angle
This parameter is optional, and its default value is 90.
EndAngle
Defines the degree of an ellipse’s end angle
This parameter is optional, and its default value is 90.
Pie
Indicates whether the newly created ellipse is a pie
This parameter is optional, and its default value is False.

The following code example creates a yellow circle in the middle of the page and a green ellipse above it:

Sub Test() 
 Dim s As Shape 
 Dim lr As Layer 
 Set lr = ActiveLayer 
 ActiveDocument.DrawingOriginX = 0 
 ActiveDocument.DrawingOriginY = 0 
 Set s = lr.CreateEllipse2(0, 0, 1) 
 s.Fill.UniformColor.RGBAssign 255, 255, 0 'Yellow 
 Set s = lr.CreateEllipse2(0, 2, 2, 1) 
 s.Fill.UniformColor.RGBAssign 0, 255, 0 'Green 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.