Skip to main content

PictureFill.FillRect Property

Specifies the portion of the shape to fill with a picture.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

RectangleOffset FillRect { get; set; }

Property Value

Type Description
RectangleOffset

An object that specifies offsets from the shape’s edges. Valid values range from -1000 (-100 000%) to 1000 (100 000%).

Remarks

Use the FillRect property to specify which part of the shape a picture should occupy. The picture is scaled to fit the specified area.

The example below shows how to fill the entire rectangle with a picture except for the top and bottom 10%.

Rich_PictureFill_FillRect

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 480, 400));
// Use a picture to fill the rectangle.
rectangle.Fill.SetPictureFill(DocumentImageSource.FromFile("PictureFill_Dog.png"));
// Specify which part of the rectangle the picture should occupy.
rectangle.Fill.PictureFill.FillRect = new RectangleOffset(0f, 0.1f, 0f, 0.1f);

Note

The FillRect property has no effect on the shape visual appearance when a document is displayed in the WinForms or WPF Rich Text Editor. However, the FillRect settings are saved to a file, so you can use Microsoft® Word® to view and print the document.

See Also