Previous Document Next Document

Object Model Reference : Classes : S : Shape : Methods : Shape.RotateEx


Shape.RotateEx

Sub RotateEx(Angle As Double, CenterX As Double, CenterY As Double)

Description

Member of Shape

The RotateEx method rotates a shape around a specified center of rotation.

Parameter
Description
Angle
Specifies the angle measurement, in degrees, in which to rotate the shape
CenterX
Specifies the x-coordinate for the center of rotation
CenterY
Specifies the y-coordinate for the center of rotation

VBA example

The following VBA example creates a flower with randomly colored petals.

Sub Test()
 Const NumLeafs As Long = 11
 Dim pal As Palette
 Dim s As Shape
 Dim i As Long, NumColors As Long
 Set s = Nothing
 If ActivePalette Is Nothing Then
  Set pal = Palettes.Open(Application.SetupPath & "Custom\coreldrw.xml")
 Else
  Set pal = ActivePalette
 End If
 NumColors = pal.ColorCount
 For i = 1 To NumLeafs
  If s Is Nothing Then
   Set s = ActiveLayer.CreateEllipse(5, 5, 7, 6)
   s.RotationCenterX = 4
   s.RotationCenterY = 5.5
  Else
   s.Duplicate
  End If
  s.Fill.ApplyUniformFill pal.Color(Rnd() * NumColors + 1)
  s.RotateEx 360 / NumLeafs, ActivePage.SizeHeight / 2, ActivePage.SizeWidth / 2
 Next i
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.