OfficeLinearGradient
OfficeIMO.Drawing
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
Explore 12 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 9
- Method OfficeLinearGradient.Clone
- Method OfficeLinearGradient.DiagonalDown
- Method OfficeLinearGradient.FromAngle
- Method OfficeLinearGradient.FromTransformedAngle
- Method OfficeLinearGradient.Horizontal
- Method OfficeLinearGradient.Vertical
- Method OfficeLinearGradient.WithColorInterpolation
- Property OfficeShape.FillGradient
- Property OfficeShape.StrokeGradient
Accepted by parameters 3
Constructors
public OfficeLinearGradient(double startX, double startY, double endX, double endY, OfficeGradientStop start, OfficeGradientStop end) #Creates a two-stop linear gradient.
Parameters
- startX double
- startY double
- endX double
- endY 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 double
- startY double
- endX double
- endY double
- stops System.Collections.Generic.IReadOnlyList<OfficeIMO.Drawing.OfficeGradientStop>
Methods
public static OfficeLinearGradient DiagonalDown(OfficeColor startColor, OfficeColor endColor) #Creates a diagonal top-left to bottom-right gradient.
Parameters
- startColor OfficeIMO.OfficeColor
- endColor OfficeIMO.OfficeColor
Returns
OfficeLinearGradientpublic static OfficeLinearGradient FromAngle(OfficeColor startColor, OfficeColor endColor, double degrees) #Creates a two-stop gradient projected through the normalized drawing rectangle at the supplied angle.
Parameters
- startColor OfficeIMO.OfficeColor
- Color at offset 0.
- endColor OfficeIMO.OfficeColor
- Color at offset 1.
- degrees double
- Clockwise angle in degrees where 0 is left-to-right in local coordinates.
public static OfficeLinearGradient FromAngle(IReadOnlyList<OfficeGradientStop> stops, double degrees) #Creates 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 double
- Clockwise angle in degrees where 0 is left-to-right in local coordinates.
public static OfficeLinearGradient FromTransformedAngle(IReadOnlyList<OfficeGradientStop> stops, double destinationDegrees, double localWidth, double localHeight, OfficeTransform localToDestination) #Creates 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 double
- Clockwise gradient angle in destination coordinates.
- localWidth double
- Width of the shape's local coordinate box.
- localHeight 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
OfficeLinearGradient A local normalized gradient that preserves the requested destination-space color-field direction.public static OfficeLinearGradient Horizontal(OfficeColor startColor, OfficeColor endColor) #Creates a horizontal left-to-right gradient.
Parameters
- startColor OfficeIMO.OfficeColor
- endColor OfficeIMO.OfficeColor
Returns
OfficeLinearGradientpublic static OfficeLinearGradient Vertical(OfficeColor startColor, OfficeColor endColor) #Creates a vertical top-to-bottom gradient.
Parameters
- startColor OfficeIMO.OfficeColor
- endColor OfficeIMO.OfficeColor
Returns
OfficeLinearGradientpublic OfficeLinearGradient WithColorInterpolation(OfficeGradientColorInterpolation interpolation) #Returns a detached gradient using the specified color interpolation space.
Parameters
- interpolation OfficeIMO.Drawing.OfficeGradientColorInterpolation
Returns
OfficeLinearGradient