Back to DOM
ShadingClass
Definition
- Namespace
- DOM.Elements.Graphics.Effects
- Assembly
- DOM.dll
Represents a shading (background fill or pattern) applied to an element.
Remarks
describes the background fill and optional foreground pattern used behind text, table cells, paragraphs, or shapes. It supports a pattern value () plus a background color and a pattern color. All properties are nullable so consumers can distinguish "not specified" from an explicit value. Shading ShadingPatternValues Shading is composed inside,, and other style classes that expose a property. ParagraphStyle.Shading TableBaseStyle.Shading Shading
Examples
csharp
1// 1. Solid light-gray shading
2var shading = new Shading
3{
4 shadingPatternValue = ShadingPatternValues.solid,
5 BackgroundColor = new Color("#F5F5F5")
6};
7
csharp
1// 2. Alternating stripe pattern
2var shading = new Shading
3{
4 shadingPatternValue = ShadingPatternValues.horzStripe,
5 BackgroundColor = new Color("#FFFFFF"),
6 PatternColor = new Color("#DDDDDD")
7};
8
csharp
1// 3. Diagonal cross-hatch pattern
2var shading = new Shading
3{
4 shadingPatternValue = ShadingPatternValues.diagCross,
5 BackgroundColor = Color.White,
6 PatternColor = Color.LightGray
7};
8
csharp
1// 4. Apply to a paragraph style
2var style = new ParagraphStyle
3{
4 Shading = new Shading
5 {
6 shadingPatternValue = ShadingPatternValues.solid,
7 BackgroundColor = new Color("#FFF9C4")
8 }
9};
10
csharp
1// 5. Apply to a table style
2var tableStyle = new TableStyle
3{
4 Shading = new Shading
5 {
6 shadingPatternValue = ShadingPatternValues.pct10,
7 BackgroundColor = Color.White,
8 PatternColor = Color.DarkGray
9 }
10};
11
Properties
BackgroundColorColor
Gets or sets the background color of the shading.
PatternColorColor
Gets or sets the pattern color of the shading.
shadingPatternValueShadingPatternValues
Gets or sets the shading pattern value.