Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GradientStopCollection Interface

A collection of gradient stops.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v24.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core

#Declaration

public interface GradientStopCollection :
    IList<GradientStop>,
    ICollection<GradientStop>,
    IEnumerable<GradientStop>,
    IEnumerable

The following members return GradientStopCollection objects:

#Remarks

Use the following methods to apply a gradient to a shape or its border:

The GradientFill object contains settings of the applied gradient fill. Use the GradientFill.GradientStops property to access the GradientStopCollection collection that stores existing gradient stops. The collection’s methods allow you to add and delete gradient stops.

The example below shows how to apply a two-color gradient to a rectangle and then specify an additional gradient stop.

Rich_ShapeFill_GradientFill_Complex

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
// Apply a gradient to the rectangle.
rectangle.Fill.SetGradientFill(GradientType.Shape, Color.FromArgb(0xFE, 0xD7, 0x66), Color.FromArgb(0x2A, 0x4D, 0x69));
// Access gradient fill settings.
GradientFill gradientFill = rectangle.Fill.GradientFill;
// Add another gradient stop.
gradientFill.GradientStops.Add(new GradientStop(0.5f, Color.FromArgb(0xFF, 0x33, 0x77)));
See Also