ShapeFill.SetPatternFill(PatternFillType, Color, Color) Method
In This Article
Applies a pattern fill to a shape.
Namespace: DevExpress.XtraRichEdit.API.Native
Assembly: DevExpress.RichEdit.v24.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
#Declaration
void SetPatternFill(
PatternFillType pattern,
Color foregroundColor,
Color backgroundColor
)
#Parameters
Name | Type | Description |
---|---|---|
pattern | Pattern |
One of the preset patterns. |
foreground |
Color | A foreground color. |
background |
Color | A background color. |
#Remarks
The example below shows how to fill a rectangle with a pattern.
// Add a rectangle to a document.
Shape rectangle = document.Shapes.InsertShape(document.Range.Start, ShapeGeometryPreset.Rectangle, new RectangleF(300, 200, 500, 300));
// Apply a pattern to the rectangle.
rectangle.Fill.SetPatternFill(PatternFillType.SolidDiamond, Color.FromArgb(0x4D, 0x64, 0x8D), Color.FromArgb(0xFF, 0xEE, 0xAD));
See Also