![]() |
![]() |
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
Member of Shape
The CreateDropShadow method applies a drop-shadow effect to a shape. This method returns an Effect object that represents the properties of a drop-shadow effect.
Parameters
|
Description
|
Type
|
Specifies the type of drop shadow in a drop-shadow effect. This value returns cdrDropShadowType.
This parameter is optional, and its default value is cdrDropShadowFlat (0).
|
Opacity
|
Specifies the opacity value of a drop-shadow effect. 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 a drop-shadow effect. 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 vertical offset of a dro- shadow effect
This parameter is optional, and its default value is 0.
|
OffsetY
|
Specifies the vertical offset of a drop-shadow effect
This parameter is optional, and its default value is 0.
|
Color
|
Specifies the color of a drop-shadow effect
This parameter is optional, and its default value is Nothing.
|
FeatherType
|
Specifies the feather type for a drop-shadow effect. Values range from 0 to 100. Low values create a more subtle feathering effect, while high values create a more pronounced effect. This property returns cdrFeatherType.
This parameter is optional, and its default value is cdrFeatherAverage (3).
|
FeatherEdge
|
Specifies the feather edge for a drop-shadow effect. Values range from 0 to 100. This property returns cdrEdgeType.
This parameter is optional, and its default value is cdrEdgeLinear (0).
|
PerspectiveAngle
|
Specifies the feather perspective angle in a drop-shadow effect
This parameter is optional, and its default value is -45.
|
PerspectiveStretch
|
Specifies the feather perspective stretch value in a drop-shadow effect
This parameter is optional, and its default value is 1.
|
Fade
|
Specifies the fade value of a drop-shadow effect. 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
|
This parameter is optional, and its default value is cdrMergeNormal (0).
|
The following code 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
![]() |
![]() |
![]() |
Copyright 2007 Corel Corporation. All rights reserved.