All docs
V20.2
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

LineFillFormat.SetGradientFill(GradientType, IEnumerable<GradientStop>) Method

Applies a complex gradient to a line or a shape's border.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

void SetGradientFill(
    GradientType gradientType,
    IEnumerable<GradientStop> gradientStops
)
Sub SetGradientFill(
    gradientType As GradientType,
    gradientStops As IEnumerable(Of GradientStop)
)

Parameters

Name Type Description
gradientType GradientType

An enumeration member that specifies the gradient type.

gradientStops IEnumerable<GradientStop>

A list of objects that contain information about gradient stops.

Remarks

The example below shows how to apply a gradient of three colors to a rectangle's outline.

Rich_ShapeLine_ComplexGradientFill

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
rectangle.Fill.SetNoFill();
// Format the rectangle's outline.
ShapeLine border = rectangle.Line;
// Apply a linear gradient of three colors to the outline.
GradientStop stop1 = new GradientStop(0f, Color.FromArgb(0x1B, 0x98, 0xE0));
GradientStop stop2 = new GradientStop(0.5f, Color.FromArgb(0xF3, 0xFF, 0xBD));
GradientStop stop3 = new GradientStop(1f, Color.FromArgb(0xFF, 0x16, 0x54));
border.Fill.SetGradientFill(GradientType.Linear, new GradientStop[] { stop1, stop2, stop3 });
border.Fill.GradientFill.Angle = 30;
// Set the line width.
border.Thickness = 6;

Use the LineFillFormat.GradientFill property to adjust existing gradient settings or add more gradient stops.

See Also