Skip to main content
All docs
V26.1
  • GradientFill.FillRect Property

    Gets or sets the region within the shape where the gradient originates or is centered.

    Namespace: DevExpress.Docs.Office

    Assembly: DevExpress.Docs.Core.v26.1.dll

    Declaration

    public RectangleOffset FillRect { get; set; }

    Property Value

    Type Description
    RectangleOffset

    The region within the shape where the gradient originates or is centered.

    Remarks

    In the following code snippet, the center shade occupies the entire shape except for the top 25%, left 25%, and right 25% of the rectangle. The gradient fills the remaining area:

    DevExpress Presentation API - Gradient Fill - FillRect

    using DevExpress.Docs.Office;
    using DevExpress.Docs.Presentation;
    using System.Drawing;
    
    GradientFill fill = new GradientFill(gradientType: GradientType.Rectangular);
    fill.GradientStops.Add(new GradientStop(Color.Cornsilk, 10));
    fill.GradientStops.Add(new GradientStop(Color.AliceBlue, 30));
    fill.GradientStops.Add(new GradientStop(Color.RoyalBlue, 90));
    fill.FillRect = new RectangleOffset(25f, 25f, 25f, 0f);
    slide.Background = new CustomSlideBackground(fill);
    
    See Also