Previous Document Next Document

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


Shape.CreateLens

Function CreateLens(Type As cdrLensType, [RateOrMagnification As Double = 50], [Color1 As Color], [Color2 As Color], [ColorMapPalette As cdrFountainFillBlendType = cdrDirectFountainFillBlend]) As Effect

Description

Member of Shape

The CreateLens method applies a lens effect to a shape, returning an Effect object that represents the lens properties.

Parameter
Description
Type
Specifies the type of lens, and returns cdrLensType
RateOrMagnification
Specifies a value between 0 and 100% that increases the degree of a lens effect. The Rate property applies to the following lens effects: Brighten, Color add, Color limit, Fish eye, and Transparency.
This parameter is optional, and its default value is 50.
Color1
Specifies the starting color in a Custom Color Map lens effect. This parameter is optional, and its default value is Nothing.
Color2
Specifies the ending color in a Custom Color Map lens effect. This parameter is optional, and its default value is Nothing.
ColorMapPalette
Specifies the type of color-map palette, and returns cdrFountainFillBlendType. This parameter is optional, and its default value is cdrDirectFountainFillBlend (0).

VBA example

The following VBA example creates a checkerboard and draws a Fish eye lens on top of it.

Sub Test()
 Dim sGrid As Shape, s As Shape
 Dim b As Boolean
 Set sGrid = ActiveLayer.CreateGridBoxes(1.748504, 8.41252, 4.712126, 5.430827, 5, 5)
 b = True
 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
  b = Not b
 Next s
 Set s = ActiveLayer.CreateEllipse(1.748504, 8.41252, 4.712126, 5.430827, 90#, 90#, False)
 s.CreateLens cdrLensFishEye, 100
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.