Previous Document Next Document
Shape.CreatePerspective

Function CreatePerspective([HorizVanishPointX As Variant], [HorizVanishPointY As Variant], [VertVanishPointX As Variant], [VertVanishPointY As Variant]) As Effect

Member of Shape

The CreatePerspective method applies a perspective effect to a shape. This method returns an Effect object that represents perspective-effect properties.

Parameters
Description
HorizVanishPointX
Specifies the x-coordinate of the horizontal vanishing point
This parameter is optional.
HorizVanishPointY
Specifies the y-coordinate of the horizontal vanishing point
This parameter is optional.
VertVanishPointX
Specifies the x-coordinate of the vertical vanishing point
This parameter is optional.
VertVanishPointY
Specifies the y-coordinate of the vertical vanishing point
This parameter is optional.

The following code example creates a 3D cube with checkerboard sides:

Sub Test() 
 Dim sGrid As Shape, s As Shape 
 Dim b As Boolean, n As Long 
 Set sGrid = ActiveLayer.CreateGridBoxes(1.549724, 7.436693, 
3.067677, 5.91874, 4, 4) 
 b = True 
 n = 0 
 For Each s In sGrid.Shapes 
  If b Then 
   s.Fill.UniformColor.RGBAssign 0, 0, 0 
  Else 
   s.Fill.UniformColor.RGBAssign 255, 255, 255 
  End If 
  n = n + 1 
  If (n Mod 4) <> 0 Then b = Not b 
 Next s 
 Set s = sGrid.Duplicate 
 s.SetBoundingBox 1.549724, 7.436693, 1.517953, 0.451447 
 s.CreatePerspective , , 6.984024, 9.839248 
 Set s = sGrid.Duplicate 
 s.SetBoundingBox 3.068583, 5.91874, 0.7395965, 1.517953 
 s.CreatePerspective 6.984024, 9.839248 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.