[]
Specifies the style for a gradient fill.
Use this enum with gradient-related members such as OneColorGradient(GradientStyle, int, double), TwoColorGradient(GradientStyle, int), and PresetGradient(GradientStyle, int, PresetGradientType) to control the direction and origin of a shape's gradient effect.
public enum GradientStyle
Public Enum GradientStyle
IShape shape = worksheet.Shapes.AddShape("GradientRect", AutoShapeType.Rectangle, 20, 20, 120, 60);
shape.Fill.TwoColorGradient(GradientStyle.Horizontal, 1);
IGradientStops gradientStops = shape.Fill.GradientStops;
gradientStops[0].Color.RGB = Color.Blue;
gradientStops[1].Color.RGB = Color.Red;
| Name | Description |
|---|---|
| DiagonalDown | Specifies a diagonal gradient moving from a top corner down to the opposite corner. |
| DiagonalUp | Specifies a diagonal gradient moving from the bottom-left corner to the opposite top-right corner. |
| FromCenter | Specifies a gradient running from the center out to the corners. Use this value to apply a center-based gradient style. When used with gradient APIs that accept a variant, only variants 1 and 2 are supported. |
| FromCorner | Specifies a gradient that runs from one corner to the other three corners. |
| FromTitle | Specifies a gradient running from the title outward. |
| Horizontal | Specifies a gradient running horizontally across the shape. |
| Mixed | Specifies a mixed gradient style. |
| Vertical | Specifies a gradient running vertically down the shape. |