Back to DOM
PatternFillClass
Definition
- Namespace
- DOM.Elements.Graphics.Colors
- Assembly
- DOM.dll
Represents a pattern fill composed of a foreground color, a background color, and a preset pattern.
Remarks
is used by to describe a two-tone pattern (dots, stripes, cross-hatch, percentages, and so on). The pattern is defined by a enum, and the two colors are optional so callers can rely on defaults when desired. PatternFill PresetPatternValues Fill.PatternFill
Examples
csharp
1// 1. 10% black dot pattern
2var fill = new PatternFill
3{
4 ForegroundColor = Color.Black,
5 BackgroundColor = Color.White,
6 Pattern = PresetPatternValues.pct10
7};
8
csharp
1// 2. Horizontal stripes
2var fill = new PatternFill
3{
4 ForegroundColor = Color.DarkBlue,
5 BackgroundColor = Color.LightBlue,
6 Pattern = PresetPatternValues.horzStripe
7};
8
csharp
1// 3. Diagonal cross-hatch
2var fill = new PatternFill
3{
4 ForegroundColor = Color.Gray,
5 BackgroundColor = Color.White,
6 Pattern = PresetPatternValues.diagCross
7};
8
csharp
1// 4. Attach to a Fill
2var f = new Fill { PatternFill = new PatternFill { Pattern = PresetPatternValues.pct20 } };
3
Properties
BackgroundColorColor
Gets or sets the background color of the pattern.
ForegroundColorColor
Gets or sets the foreground color of the pattern.
PatternPresetPatternValues
Gets or sets the preset pattern type.