Skip to main content
All docs
V25.2
  • ReflectionEffect.Alignment Property

    Gets or sets the shadow alignment of the reflection effect.

    Namespace: DevExpress.Docs.Presentation

    Assembly: DevExpress.Docs.Presentation.v25.2.dll

    NuGet Package: DevExpress.Docs.Presentation

    Declaration

    public RectangleAlignType Alignment { get; set; }

    Property Value

    Type Description
    RectangleAlignType

    The shadow alignment of the reflection effect.

    Available values:

    Name Description
    TopLeft

    The rectangle is aligned to the top-left corner of the object.

    Top

    The rectangle is aligned to the top of the object.

    TopRight

    The rectangle is aligned to the top-right corner of the object.

    Left

    The rectangle is aligned to the left of the object.

    Center

    The rectangle is centered.

    Right

    The rectangle is aligned to the right of the object.

    BottomLeft

    The rectangle is aligned to the bottom-left corner of the object.

    Bottom

    The rectangle is aligned to the bottom.

    BottomRight

    The rectangle is aligned to the bottom-right corner of the object.

    Remarks

    The ReflectionEffect class exposes properties that you can use to configure the reflection effect:

    Angle
    Specifies the angle of the reflection effect in degrees.
    BlurRadius
    Specifies the blur radius of the reflection effect.
    Distance
    Specifies how far to offset the reflection relative to the shape.
    StartOpacity | EndOpacity
    Specifies the start and end opacity of the reflection effect.
    StartPosition | EndPosition
    Specifies the start and end position of the reflection effect.
    FadeAngle
    Specifies the fade angle of the reflection effect.
    HorizontalScale | VerticalScale
    Specifies the horizontal and vertical scale factors of the reflection effect.
    HorizontalSkew | VerticalSkew
    Specifies 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.
    RotateWithShape
    Specifies 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;
        }
    }
    
    See Also