OuterShadowEffect Class
Contains properties to configure an outer shadow effect.
Declaration
public class OuterShadowEffect extends OfficeObject
Remarks
Use the following methods to configure the outer shadow effect:
| Method | Description | Image |
|---|---|---|
| setColor(OfficeColor value) | Specifies the outer shadow color. | |
| setHorizontalScale(float value) | Specifies the horizontal scale factor of the shadow. | |
| setVerticalScale(float value) | Specifies the vertical scale factor of the shadow. | |
| setHorizontalSkew(float value) | Specifies the horizontal skew angle of the shadow. | |
| setRotateWithShape(boolean value) | Specifies whether the shadow rotates with the shape. | |
| setBlurRadius(float value) | Specifies the outer shadow’s blur radius. | ![]() |
| setAngle(float value) | Specifies the angle to offset the shadow. | ![]() |
| setDistance(float value) | Specifies how far to offset the shadow. | ![]() |
| setVerticalSkew(float value) | Specifies the vertical skew angle of the shadow. | ![]() |
The following code snippet applies an outer shadow effect to a shape:
import com.devexpress.docs.*;
import com.devexpress.docs.office.*;
import com.devexpress.system.drawing.*;
import com.devexpress.docs.presentation.*;
// Create a presentation.
try(Presentation presentation = new Presentation()) {
ShapeEffectProperties effectProperties = new ShapeEffectProperties();
effectProperties.setOuterShadow(new OuterShadowEffect() {{
setAngle(135);
setBlurRadius(50);
setColor(new OfficeColor(Color.getGray()));
setDistance(50);
setHorizontalScale(100);
setVerticalScale(100);
setHorizontalSkew(0);
setVerticalSkew(0);
setRotateWithShape(true);
}});
Shape shape = new Shape(ShapeType.getRectangle(), 10, 10, 300, 300) {{
setOutline(new LineStyle());
getOutline().setFill(new SolidFill(Color.getRoyalBlue()));
getOutline().setWidth(8);
setFill(new SolidFill(Color.getWhite()));
setEffects(effectProperties);
}};
// Access the first slide in the presentation.
Slide slide = presentation.getSlides().getFirst();
slide.getShapes().add(shape);
// Perform additional presentation processing logic.
}
Inherited Members
Inheritance
OuterShadowEffect()
Initializes a new instance of the OuterShadowEffect class.
Declaration
public OuterShadowEffect()
Methods
deepClone() Method
Returns a deep copy of this OuterShadowEffect instance.
Declaration
public OuterShadowEffect deepClone()
Returns
| Type | Description |
|---|---|
OuterShadowEffect |
A deep copy of this |
getAngle() Method
Returns the angle to offset the shadow.
Declaration
public float getAngle()
Returns
| Type | Description |
|---|---|
| float | The angle in degrees. |
getBlurRadius() Method
Returns the outer shadow’s blur radius.
Declaration
public float getBlurRadius()
Returns
| Type | Description |
|---|---|
| float | The outer shadow’s blur radius in Document units (1/300 of an inch). |
getColor() Method
Returns the shadow color.
Declaration
public OfficeColor getColor()
Returns
| Type | Description |
|---|---|
| OfficeColor | The shadow color. |
getDistance() Method
Returns how far to offset the shadow.
Declaration
public float getDistance()
Returns
| Type | Description |
|---|---|
| float | The distance to offset the shadow in Document units (1/300 of an inch). |
getHorizontalScale() Method
Returns the horizontal scale of the shadow.
Declaration
public float getHorizontalScale()
Returns
| Type | Description |
|---|---|
| float | The scale factor that is expressed as a percentage in the range of 0 to 200. |
getHorizontalSkew() Method
Returns the horizontal skew angle of the shadow.
Declaration
public float getHorizontalSkew()
Returns
| Type | Description |
|---|---|
| float | The horizontal skew angle of the shadow in degrees. This method can have values in the (-90, 90) range. |
getRotateWithShape() Method
Returns whether the shadow rotates with the shape.
Declaration
public boolean getRotateWithShape()
Returns
| Type | Description |
|---|---|
| boolean |
|
getShadowAlignment() Method
Returns the shadow alignment relative to the shape.
Declaration
public RectangleAlignType getShadowAlignment()
Returns
| Type | Description |
|---|---|
| RectangleAlignType | The shadow alignment relative to the shape. |
Remarks
The setAngle method has a higher priority than the setShadowAlignment method.
getVerticalScale() Method
Returns the vertical scale of the shadow.
Declaration
public float getVerticalScale()
Returns
| Type | Description |
|---|---|
| float | The scale factor that is expressed as a percentage in the range of 0 to 200. |
getVerticalSkew() Method
Returns the vertical skew angle of the shadow.
Declaration
public float getVerticalSkew()
Returns
| Type | Description |
|---|---|
| float | The vertical skew angle of the shadow in degrees. This method can have values in the (-90, 90) range. |
setAngle(float value) Method
Sets the angle to offset the shadow.
Declaration
public void setAngle(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The angle in degrees. |
setBlurRadius(float value) Method
Sets the outer shadow’s blur radius.
Declaration
public void setBlurRadius(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The outer shadow’s blur radius in Document units (1/300 of an inch). |
setColor(OfficeColor value) Method
Sets the shadow color.
Declaration
public void setColor(OfficeColor value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | OfficeColor | The shadow color. |
setDistance(float value) Method
Sets how far to offset the shadow.
Declaration
public void setDistance(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The distance to offset the shadow in Document units (1/300 of an inch). |
setHorizontalScale(float value) Method
Sets the horizontal scale of the shadow.
Declaration
public void setHorizontalScale(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The scale factor that is expressed as a percentage in the range of 0 to 200. |
setHorizontalSkew(float value) Method
Sets the horizontal skew angle of the shadow.
Declaration
public void setHorizontalSkew(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The horizontal skew angle of the shadow in degrees. This method can have values in the (-90, 90) range. |
setRotateWithShape(boolean value) Method
Sets whether the shadow rotates with the shape.
Declaration
public void setRotateWithShape(boolean value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | boolean |
|
setShadowAlignment(RectangleAlignType value) Method
Sets the shadow alignment relative to the shape.
Declaration
public void setShadowAlignment(RectangleAlignType value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | RectangleAlignType | The shadow alignment relative to the shape. |
Remarks
The setAngle method has a higher priority than the setShadowAlignment method.
setVerticalScale(float value) Method
Sets the vertical scale of the shadow.
Declaration
public void setVerticalScale(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The scale factor that is expressed as a percentage in the range of 0 to 200. |
setVerticalSkew(float value) Method
Sets the vertical skew angle of the shadow.
Declaration
public void setVerticalSkew(float value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | float | The vertical skew angle of the shadow in degrees. |



