All docs
V21.1
21.2 (EAP/Beta)
21.1
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+

ShapeFill.PictureFill Property

Provides access to picture fill settings.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

PictureFill PictureFill { get; }

Property Value

Type Description
PictureFill

An object that stores picture fill settings.

Remarks

Picture Fill

Call the Shape.Fill.SetPictureFill method to fill a shape with a picture. Use the Shape.Fill.PictureFill.FillRect property to specify which part of the shape the picture should occupy.

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);

Texture Fill

Set the Shape.Fill.PictureFill.Stretch property to false to tile the shape with a picture as shown below.

Rich_TextureFill

// Create a rectangle.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 350));
// Use a picture to fill the rectangle.
rectangle.Fill.SetPictureFill(DocumentImageSource.FromFile("PictureFill_Leaf.png"));
// Access picture fill settings.
PictureFill pictureFill = rectangle.Fill.PictureFill;
// Tile the picture as texture.
pictureFill.Stretch = false;
// Scale the picture to 50% of its original size.
pictureFill.ScaleX = 0.5f;
pictureFill.ScaleY = 0.5f;
// Specify the first tile position.
pictureFill.TileAlign = TileAlignType.TopLeft;
// Specify the mirror type for tiles.
pictureFill.TileFlip = TileFlipType.Vertical;
See Also