Back to DOM
LinearShadeClass
Definition
- Namespace
- DOM.Elements.Graphics.Colors
- Assembly
- DOM.dll
Represents a linear gradient shade used to describe the direction and scaling of a linear gradient.
Remarks
is attached to a to indicate that the gradient should be drawn along a straight line. The line's direction is defined by, and controls whether the gradient is scaled to the shape's bounding box or uses absolute dimensions. LinearShade Gradient Angle Scaled
Examples
csharp
1// 1. Left-to-right gradient
2var shade = new LinearShade { Angle = 0, Scaled = true };
3
csharp
1// 2. Top-to-bottom gradient
2var shade = new LinearShade { Angle = 90, Scaled = true };
3
csharp
1// 3. Diagonal gradient with absolute dimensions
2var shade = new LinearShade { Angle = 45, Scaled = false };
3
csharp
1// 4. Attach to a gradient
2var gradient = new Gradient
3{
4 GradientStops = new List<IGradientStop> { /* ... */ },
5 LinearShade = new LinearShade { Angle = 135 }
6};
7
Properties
AngleRotation
Gets or sets the angle of the linear gradient.
Scaled
Gets or sets a value indicating whether the gradient is scaled to the shape's bounding box.