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, Color, Color) Method

Applies a two-color 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,
    Color color1,
    Color color2
)
Sub SetGradientFill(
    gradientType As GradientType,
    color1 As Color,
    color2 As Color
)

Parameters

Name Type Description
gradientType GradientType

An enumeration member that specifies the gradient type.

color1 Color

A color at the start point (0).

color2 Color

A color at the end point (1).

Remarks

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

Rich_ShapeLine_GradientFill

// 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 gradient of two colors to the outline.
border.Fill.SetGradientFill(GradientType.Linear, Color.FromArgb(0x4D, 0x64, 0x8D), Color.FromArgb(0xFF, 0x8B, 0x94));
// Set the line width.
border.Thickness = 6;

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

See Also