Skip to main content

GradientFill.TileRect Property

Specifies the rectangular region to which a gradient is applied. This region is tiled to fill the shape.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

RectangleOffset TileRect { get; set; }

Property Value

Type Description
RectangleOffset

An object that specifies offsets (in percentage) from the edges of a shape’s bounding box to the tile rectangle. A positive percentage specifies an inset, and a negative percentage defines an outset.

Remarks

The example below shows how to tile a linear gradient fill. The rightmost 25% of the shape contains the tile rectangle to which a gradient is applied. The gradient is tiled three times to cover the leftmost 75% of the shape. The tile rectangle is flipped horizontally to fill the shape.

Rich_GradientFill_TileRect_Example

// Add a rectangle to the document.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
// Fill the rectangle with a gradient.
rectangle.Fill.SetGradientFill(GradientType.Linear, Color.FromArgb(0xF6, 0xCD, 0x61), Color.FromArgb(0xEE, 0x40, 0x35));
// Tile the gradient.
rectangle.Fill.GradientFill.TileRect = new RectangleOffset(0.75f, 0.0f, 0.0f, 0.0f);
See Also