Class GradientFill

Class GradientFill

Namespace: Aspose.Cells.Drawing
Assembly: Aspose.Cells.dll (25.2.0)

Represents the gradient fill.

public class GradientFill : Fill

Inheritance

objectFillGradientFill

Inherited Members

Fill.Equals(object), Fill.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

Angle

The angle of linear fill.

public float Angle { get; set; }

Property Value

float

DirectionType

Gets the gradient direction type.

public GradientDirectionType DirectionType { get; }

Property Value

GradientDirectionType

FillType

Gets the gradient fill type.

public GradientFillType FillType { get; }

Property Value

GradientFillType

GradientStops

Represents the gradient stop collection.

public GradientStopCollection GradientStops { get; }

Property Value

GradientStopCollection

Methods

SetGradient(GradientFillType, double, GradientDirectionType)

Set the gradient fill type and direction.

public void SetGradient(GradientFillType type, double angle, GradientDirectionType direction)

Parameters

type GradientFillType

Gradient fill type.

angle double

The angle. Only applies for GradientFillType.Linear.

direction GradientDirectionType

The direction type. Only applies for GradientFillType.Radial and GradientFillType.Rectangle.

SetOneColorGradient(Color, double, GradientStyleType, int)

Sets the specified fill to a one-color gradient. Only applies for Excel 2007.

public void SetOneColorGradient(Color color, double degree, GradientStyleType style, int variant)

Parameters

color Color

One gradient color.

degree double

The gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).

style GradientStyleType

Gradient shading style.

variant int

The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

SetPresetThemeGradient(PresetThemeGradientType, ThemeColorType)

Sets preset theme gradient fill.

public void SetPresetThemeGradient(PresetThemeGradientType gradientType, ThemeColorType themeColorType)

Parameters

gradientType PresetThemeGradientType

The preset gradient type.

themeColorType ThemeColorType

The theme color type.

SetTwoColorGradient(Color, Color, GradientStyleType, int)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

public void SetTwoColorGradient(Color color1, Color color2, GradientStyleType style, int variant)

Parameters

color1 Color

One gradient color.

color2 Color

Two gradient color.

style GradientStyleType

Gradient shading style.

variant int

The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

SetTwoColorGradient(Color, double, Color, double, GradientStyleType, int)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

public void SetTwoColorGradient(Color color1, double transparency1, Color color2, double transparency2, GradientStyleType style, int variant)

Parameters

color1 Color

One gradient color.

transparency1 double

The degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).

color2 Color

Two gradient color.

transparency2 double

The degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).

style GradientStyleType

Gradient shading style.

variant int

The gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.