Back to Devexpress

GradientFill Interface

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-e8d55ad5.md

latest3.3 KB
Original Source

GradientFill Interface

Contains gradient fill settings.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public interface GradientFill
vb
Public Interface GradientFill

The following members return GradientFill objects:

Remarks

Use the GradientFill object’s properties to change a gradient applied to a shape or its border:

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

csharp
// 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)));
vb
' Create a rectangle.
Dim rectangle As Shape = 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(&HFE, &HD7, &H66), Color.FromArgb(&H2A, &H4D, &H69))
' Access gradient fill settings.
Dim gradientFill As GradientFill = rectangle.Fill.GradientFill
' Add another gradient stop.
gradientFill.GradientStops.Add(New GradientStop(0.5F, Color.FromArgb(&HFF, &H33, &H77)))

See Also

GradientFill Members

DevExpress.XtraRichEdit.API.Native Namespace