Previous Document Next Document

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


Shape.CreatePerspective

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

Description

Member of Shape

The CreatePerspective method applies a perspective to a shape, returning an Effect object that represents the perspective properties.

Parameter
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.

VBA example

The following VBA example creates a three-dimensional 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 2013 Corel Corporation. All rights reserved.