API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.CreateLens method
Creates a lens effect
Syntax:
Function CreateLens(ByVal Type As cdrLensType, Optional ByVal RateOrMagnification As Double = 50, Optional ByVal Color1 As Color = Nothing, Optional ByVal Color2 As Color = Nothing, Optional ByVal ColorMapPalette As cdrFountainFillBlendType = cdrDirectFountainFillBlend) As Effect
Parameters:
Name Type Description
Type
RateOrMagnification
Double
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.
Color1
Specifies the starting color in a Custom Color Map lens effect.
Color2
Specifies the ending color in a Custom Color Map lens effect.
ColorMapPalette
Specifies the type of color-map palette, and returns cdrFountainFillBlendType.
Remarks:
The CreateLens method applies a lens effect to a shape, returning an Effect object that represents the lens properties.
Examples:
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