Skip to main content

PictureFill.Stretch Property

Specifies whether the picture is stretched to fill the shape.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

bool Stretch { get; set; }

Property Value

Type Description
Boolean

true to stretch the picture; otherwise, false. The default is true.

Remarks

Picture Fill

If the Stretch property is true (the default value), the picture is stretched over the shape. You can use the PictureFill.FillRect property to specify which part of the shape the picture occupies.

Texture Fill

Set the 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