Previous Document Next Document
Shape.Clone

Function Clone([OffsetX As Double], [OffsetY As Double]) As Shape

Member of Shape

The Clone method clones a shape and return the reference to the cloned object.

Parameters
Description
OffsetX
Specifies the horizontal distance to offset the cloned shape object
This parameter is optional, and its default value is 0.
OffsetY
Specifies the vertical distance to offset the cloned shape object
This parameter is optional, and its default value is 0.

The following code example creates a red rectangle, clones it, and then changes the fill of the clone to green:

Sub Test() 
 Dim rs As Shape, cs As Shape 
 Set rs = ActiveLayer.CreateRectangle2(0, 0, 4, 2) 
 rs.Fill.UniformColor.CMYKAssign 0, 100, 100, 0 
 Set cs = rs.Clone(0, 3) 
 cs.Fill.UniformColor.CMYKAssign 100, 0, 100, 0 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.