officefileapi-devexpress-dot-docs-dot-presentation-dot-reflectioneffect-75997115.md
Gets or sets how far to offset the reflection.
Namespace : DevExpress.Docs.Presentation
Assembly : DevExpress.Docs.Presentation.v25.2.dll
NuGet Package : DevExpress.Docs.Presentation
public float Distance { get; set; }
Public Property Distance As Single
| Type | Description |
|---|---|
| Single |
The distance to offset the reflection in Document units (1/300 of an inch).
|
The ReflectionEffect class exposes properties that you can use to configure the reflection effect:
AngleSpecifies the angle of the reflection effect in degrees.BlurRadiusSpecifies the blur radius of the reflection effect.DistanceSpecifies how far to offset the reflection relative to the shape.StartOpacity | EndOpacitySpecifies the start and end opacity of the reflection effect.StartPosition | EndPositionSpecifies the start and end position of the reflection effect.FadeAngleSpecifies the fade angle of the reflection effect.HorizontalScale | VerticalScaleSpecifies the horizontal and vertical scale factors of the reflection effect.HorizontalSkew | VerticalSkewSpecifies the horizontal and vertical skew angles of the reflection effect. This property is measured in degrees and can have values in the (-90, 90) range.RotateWithShapeSpecifies whether the reflection effect rotates with the shape.
The following code snippet applies a reflection effect to a shape:
using DevExpress.Docs.Presentation;
using System.Drawing;
namespace PresentationApiSample;
public class Program {
public static void Main(string[] _) {
Presentation presentation = new Presentation();
presentation.Slides.Clear();
Slide slide = new Slide(SlideLayoutType.Blank);
presentation.Slides.Add(slide);
Shape shape1 = new Shape(ShapeType.Rectangle);
shape1.Outline = new OutlineStyle { Fill = new SolidFill(Color.RoyalBlue), Width = 8 };
shape1.Fill = new SolidFill(Color.RoyalBlue);
shape1.X = 1100;
shape1.Y = 1100;
shape1.Width = 300;
shape1.Height = 300;
slide.Shapes.Add(shape1);
ShapeEffectProperties e_properties = new ShapeEffectProperties();
e_properties.Reflection = new ReflectionEffect {
Angle = 45,
BlurRadius = 50,
Distance = 50,
StartOpacity = 0,
EndOpacity = 100,
StartPosition = 0,
EndPosition = 100,
FadeAngle = 45,
HorizontalScale = 100,
VerticalScale = 100,
HorizontalSkew = 0,
VerticalSkew = 0,
RotateWithShape = true,
ShadowAlignment = RectangleAlignType.Center
};
shape1.Effects = e_properties;
}
}
Imports DevExpress.Docs.Presentation
Imports System.Drawing
Namespace PresentationApiSample
Public Class Program
Public Shared Sub Main(ByVal args As String())
Dim presentation As New Presentation()
presentation.Slides.Clear()
Dim slide As New Slide(SlideLayoutType.Blank)
presentation.Slides.Add(slide)
Dim shape1 As New Shape(ShapeType.Rectangle)
shape1.Outline = New OutlineStyle With {
.Fill = New SolidFill(Color.RoyalBlue),
.Width = 8
}
shape1.Fill = New SolidFill(Color.RoyalBlue)
shape1.X = 1100
shape1.Y = 1100
shape1.Width = 300
shape1.Height = 300
slide.Shapes.Add(shape1)
Dim e_properties As New ShapeEffectProperties()
e_properties.Reflection = New ReflectionEffect With {
.Angle = 45,
.BlurRadius = 50,
.Distance = 50,
.StartOpacity = 0,
.EndOpacity = 100,
.StartPosition = 0,
.EndPosition = 100,
.FadeAngle = 45,
.HorizontalScale = 100,
.VerticalScale = 100,
.HorizontalSkew = 0,
.VerticalSkew = 0,
.RotateWithShape = True,
.ShadowAlignment = RectangleAlignType.Center
}
shape1.Effects = e_properties
End Sub
End Class
End Namespace
See Also