Previous Document Next Document

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


Shape.CreateDropShadow

Function CreateDropShadow([Type As cdrDropShadowType = cdrDropShadowFlat], [Opacity As Long = 50], [Feather As Long = 15], [OffsetX As Double], [OffsetY As Double], [Color As Color], [FeatherType As cdrFeatherType = cdrFeatherAverage], [FeatherEdge As cdrEdgeType = cdrEdgeLinear], [PerspectiveAngle As Double = -45], [PerspectiveStretch As Double = 1], [Fade As Long = 1], [MergeMode As cdrMergeMode = cdrMergeNormal]) As Effect

Description

Member of Shape

The CreateDropShadow method applies a drop shadow to a shape, returning an Effect object that represents the drop-shadow properties.

Parameter
Description
Type
Specifies the type of drop shadow, and returns cdrDropShadowType. This parameter is optional, and its default value is cdrDropShadowFlat (0).
Opacity
Specifies the opacity value of the drop shadow. Values range from 0 to 100. Low values create a less opaque drop shadow, while high values create a more opaque drop shadow. This parameter is optional, and its default value is 50.
Feather
Specifies the feather length for the drop shadow. Values range from 0 to 100. Low values create a more subtle feathering effect, while high values create a more pronounced effect. This parameter is optional, and its default value is 15.
OffsetX
Specifies the horizontal offset of the drop shadow. This parameter is optional, and its default value is 0.
OffsetY
Specifies the vertical offset of the drop shadow. This parameter is optional, and its default value is 0.
Color
Specifies the color of the drop shadow. This parameter is optional, and its default value is Nothing.
FeatherType
Specifies the feather type for the drop shadow, and returns cdrFeatherType. Values range from 0 to 100. Low values create a more subtle feathering effect, while high values create a more pronounced effect. This parameter is optional, and its default value is cdrFeatherAverage (3).
FeatherEdge
Specifies the feather edge for the drop shadow, and returns cdrEdgeType. Values range from 0 to 100. This parameter is optional, and its default value is cdrEdgeLinear (0).
PerspectiveAngle
Specifies the feather perspective angle in the drop shadow. This parameter is optional, and its default value is -45.
PerspectiveStretch
Specifies the feather perspective stretch value in the drop shadow. This parameter is optional, and its default value is 1.
Fade
Specifies the fade value of the drop shadow. The fade level of a drop shadow that has a Flat perspective cannot be changed. This parameter is optional, and its default value is 1.
MergeMode
Specifies the merge mode for the drop shadow. This parameter is optional, and its default value is cdrMergeNormal (0).

VBA example

The following VBA example creates a cut-out effect.

Sub Test()
 Const Border As Double = 0.5
 Dim s As Shape, sRect As Shape, sShadow As Shape
 Dim eff As Effect, sr As New ShapeRange
 Dim x As Double, y As Double, sx As Double, sy As Double
 Set s = ActiveLayer.CreateArtisticText(4, 5, "Cut")
 With s.Text.FontProperties
  .Name = "Arial"
  .Size = 200
  .Style = cdrBoldFontStyle
 End With
 s.Text.AlignProperties.Alignment = cdrCenterAlignment
 s.GetBoundingBox x, y, sx, sy
 Set sRect = ActiveLayer.CreateRectangle2(x - Border, y - Border, sx + 2 * Border, sy + 2 * Border)
 s.Selected = True
 Set sRect = ActiveSelection.Combine
 sRect.Fill.UniformColor.CMYKAssign 30, 0, 0, 0
 Set eff = sRect.CreateDropShadow(cdrDropShadowFlat, 80, 10, 0.2, -0.2, CreateCMYKColor(0, 0, 0, 100))
 eff.Separate
 Set sShadow = sRect.Next
 Set s = ActiveLayer.CreateRectangle2(x, y, sx, sy)
 s.Fill.ApplyNoFill
 s.Outline.Type = cdrNoOutline
 sShadow.AddToPowerClip s
 s.OrderBackOf sRect
 sr.Add s
 sr.Add sRect
 sr.Group.CreateSelection
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.