API Reference
OfficeLinearGradient
Dependency-free linear gradient intent in normalized local coordinates. Coordinates use a top-left origin where 0,0 is the shape's top-left corner and 1,1 is its bottom-right corner. Importers may preserve finite user-space vectors that cross those bounds without weakening public constructor validation.
Inheritance
- Object
- OfficeLinearGradient
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method OfficeLinearGradient.Clone
- Method OfficeLinearGradient.DiagonalDown
- Method OfficeLinearGradient.FromAngle
- Method OfficeLinearGradient.FromAngle
- Method OfficeLinearGradient.FromTransformedAngle
- Method OfficeLinearGradient.Horizontal
- Method OfficeLinearGradient.Vertical
- Property OfficeShape.FillGradient
- Property OfficeShape.StrokeGradient
Accepted by parameters
Constructors
public OfficeLinearGradient(Double startX, Double startY, Double endX, Double endY, OfficeGradientStop start, OfficeGradientStop end) #Creates a two-stop linear gradient.
Parameters
- startX System.Double
- startY System.Double
- endX System.Double
- endY System.Double
- start OfficeIMO.Drawing.OfficeGradientStop
- end OfficeIMO.Drawing.OfficeGradientStop
public OfficeLinearGradient(Double startX, Double startY, Double endX, Double endY, IReadOnlyList<OfficeGradientStop> stops) #Creates a linear gradient with two or more ordered stops.
Parameters
- startX System.Double
- startY System.Double
- endX System.Double
- endY System.Double
- stops System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficeGradientStop}
Methods
public static OfficeLinearGradient DiagonalDown(OfficeColor startColor, OfficeColor endColor) #OfficeLinearGradientCreates a diagonal top-left to bottom-right gradient.
Parameters
- startColor OfficeIMO.Drawing.OfficeColor
- endColor OfficeIMO.Drawing.OfficeColor
public static OfficeLinearGradient FromAngle(OfficeColor startColor, OfficeColor endColor, Double degrees) #OfficeLinearGradientCreates a two-stop gradient projected through the normalized drawing rectangle at the supplied angle.
Parameters
- startColor OfficeIMO.Drawing.OfficeColor
- Color at offset 0.
- endColor OfficeIMO.Drawing.OfficeColor
- Color at offset 1.
- degrees System.Double
- Clockwise angle in degrees where 0 is left-to-right in local coordinates.
Returns
A gradient with endpoints clamped to the normalized drawing rectangle.
public static OfficeLinearGradient FromAngle(IReadOnlyList<OfficeGradientStop> stops, Double degrees) #OfficeLinearGradientCreates a gradient with ordered stops projected through the normalized drawing rectangle at the supplied angle.
Parameters
- stops System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficeGradientStop}
- Gradient stops. The first stop must be offset 0 and the last stop must be offset 1.
- degrees System.Double
- Clockwise angle in degrees where 0 is left-to-right in local coordinates.
Returns
A gradient with endpoints clamped to the normalized drawing rectangle.
public static OfficeLinearGradient FromTransformedAngle(IReadOnlyList<OfficeGradientStop> stops, Double destinationDegrees, Double localWidth, Double localHeight, OfficeTransform localToDestination) #OfficeLinearGradientCreates a local-coordinate gradient whose color-field normal follows the supplied angle after an affine shape transform.
Parameters
- stops System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficeGradientStop}
- Gradient stops. The first stop must use offset 0 and the last stop offset 1.
- destinationDegrees System.Double
- Clockwise gradient angle in destination coordinates.
- localWidth System.Double
- Width of the shape's local coordinate box.
- localHeight System.Double
- Height of the shape's local coordinate box.
- localToDestination OfficeIMO.Drawing.OfficeTransform
- Affine transform applied to the shape after its local gradient is evaluated.
Returns
A local normalized gradient that preserves the requested destination-space color-field direction.
public static OfficeLinearGradient Horizontal(OfficeColor startColor, OfficeColor endColor) #OfficeLinearGradientCreates a horizontal left-to-right gradient.
Parameters
- startColor OfficeIMO.Drawing.OfficeColor
- endColor OfficeIMO.Drawing.OfficeColor
public static OfficeLinearGradient Vertical(OfficeColor startColor, OfficeColor endColor) #OfficeLinearGradientCreates a vertical top-to-bottom gradient.
Parameters
- startColor OfficeIMO.Drawing.OfficeColor
- endColor OfficeIMO.Drawing.OfficeColor
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public Double StartX { get; } #Normalized start X coordinate.
public Double StartY { get; } #Normalized start Y coordinate.
public Double EndX { get; } #Normalized end X coordinate.
public Double EndY { get; } #Normalized end Y coordinate.
public IReadOnlyList<OfficeGradientStop> Stops { get; } #Gradient stops in offset order.