Class Shadow
Inheritance
System.Object
Shadow
Assembly: IronPPT.dll
Syntax
public class Shadow : Object
Drop-shadow styling on text and shapes is captured by Shadow. It describes how a shadow is offset, blurred, scaled, and skewed behind an element, so a developer can lift a heading or shape off the slide with a soft cast shadow instead of leaving it flat.
A Shadow is attached to the element being styled, and the quickest start is the static Shadow OuterShadow1 preset, a ready-made outer shadow that needs no manual tuning. From there the properties fall into clear groups. Offset and blur control the cast: BlurRadius softens the edge, DistanceFromText sets how far the shadow sits from the element, and DirectionAngle aims it. Transform controls reshape the cast: HorizontalScalingFactor and VerticalScalingFactor stretch it, HorizontalSkewAngle and VerticalSkewAngle lean it, and Alignment (a RectangleAlignmentValues) anchors it. Color is set through SchemeColor.
Because shadow distances are measured quantities, BlurRadius and DistanceFromText have unit-aware accessors: call GetBlurRadius and GetDistanceFromText with a Units value to read in a chosen unit, and SetBlurRadius and SetDistanceFromText to write a value in that unit. Reading and writing through these accessors keeps a layout consistent whether the rest of the deck is measured in points, inches, or centimeters, and avoids hard-coding a single unit into the shadow. The SchemeColor property ties the shadow's color to the presentation, so a shadow can pick up a theme color rather than a fixed value. Reach for OuterShadow1 for a sensible default and override individual properties only when the design calls for it.
var shadow = Shadow.OuterShadow1;
shadow.SetBlurRadius(4, Units.Point);
shadow.DirectionAngle = 45;
The add shape example creates and styles a shape, the add text how-to places text that a shadow can lift, and the paragraph style example styles the surrounding content.
Constructors
Shadow()
Declaration
Fields
OuterShadow1
Declaration
public static Shadow OuterShadow1
Field Value
Properties
Alignment
Declaration
public RectangleAlignmentValues Alignment { get; set; }
Property Value
BlurRadius
Declaration
public double BlurRadius { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
DirectionAngle
Declaration
public double DirectionAngle { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
DistanceFromText
Declaration
public double DistanceFromText { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
HorizontalScalingFactor
Declaration
public int HorizontalScalingFactor { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
HorizontalSkewAngle
Declaration
public double HorizontalSkewAngle { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
SchemeColor
Declaration
public Color SchemeColor { get; set; }
Property Value
VerticalScalingFactor
Declaration
public double VerticalScalingFactor { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
VerticalSkewAngle
Declaration
public double VerticalSkewAngle { get; set; }
Property Value
| Type |
Description |
| System.Double |
|
Methods
GetBlurRadius(Units)
Declaration
public double GetBlurRadius(Units measurementUnit)
Parameters
| Type |
Name |
Description |
| Units |
measurementUnit |
|
Returns
| Type |
Description |
| System.Double |
|
GetDistanceFromText(Units)
Declaration
public double GetDistanceFromText(Units measurementUnit)
Parameters
| Type |
Name |
Description |
| Units |
measurementUnit |
|
Returns
| Type |
Description |
| System.Double |
|
SetBlurRadius(Double, Units)
Declaration
public void SetBlurRadius(double blurRadius, Units measurementUnit)
Parameters
| Type |
Name |
Description |
| System.Double |
blurRadius |
|
| Units |
measurementUnit |
|
SetDistanceFromText(Double, Units)
Declaration
public void SetDistanceFromText(double distance, Units measurementUnit)
Parameters
| Type |
Name |
Description |
| System.Double |
distance |
|
| Units |
measurementUnit |
|