Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OfficeLinearGradient

Namespace OfficeIMO.Drawing
Assembly OfficeIMO.Core
Modifiers sealed

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.

Accepted by parameters

Constructors

OfficeLinearGradient 2 overloads
public OfficeLinearGradient(Double startX, Double startY, Double endX, Double endY, OfficeGradientStop start, OfficeGradientStop end) #

Creates a two-stop linear gradient.

Parameters

startX System.Double requiredposition: 0
startY System.Double requiredposition: 1
endX System.Double requiredposition: 2
endY System.Double requiredposition: 3
start OfficeIMO.Drawing.OfficeGradientStop requiredposition: 4
end OfficeIMO.Drawing.OfficeGradientStop requiredposition: 5
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 requiredposition: 0
startY System.Double requiredposition: 1
endX System.Double requiredposition: 2
endY System.Double requiredposition: 3
stops System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficeGradientStop} requiredposition: 4

Methods

public OfficeLinearGradient Clone() #
Returns: OfficeLinearGradient

Creates a detached copy.

public static OfficeLinearGradient DiagonalDown(OfficeColor startColor, OfficeColor endColor) #
Returns: OfficeLinearGradient

Creates a diagonal top-left to bottom-right gradient.

Parameters

startColor OfficeIMO.Drawing.OfficeColor requiredposition: 0
endColor OfficeIMO.Drawing.OfficeColor requiredposition: 1
FromAngle 2 overloads
public static OfficeLinearGradient FromAngle(OfficeColor startColor, OfficeColor endColor, Double degrees) #
Returns: OfficeLinearGradient

Creates a two-stop gradient projected through the normalized drawing rectangle at the supplied angle.

Parameters

startColor OfficeIMO.Drawing.OfficeColor requiredposition: 0
Color at offset 0.
endColor OfficeIMO.Drawing.OfficeColor requiredposition: 1
Color at offset 1.
degrees System.Double requiredposition: 2
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) #
Returns: OfficeLinearGradient

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} requiredposition: 0
Gradient stops. The first stop must be offset 0 and the last stop must be offset 1.
degrees System.Double requiredposition: 1
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) #
Returns: OfficeLinearGradient

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} requiredposition: 0
Gradient stops. The first stop must use offset 0 and the last stop offset 1.
destinationDegrees System.Double requiredposition: 1
Clockwise gradient angle in destination coordinates.
localWidth System.Double requiredposition: 2
Width of the shape's local coordinate box.
localHeight System.Double requiredposition: 3
Height of the shape's local coordinate box.
localToDestination OfficeIMO.Drawing.OfficeTransform requiredposition: 4
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) #
Returns: OfficeLinearGradient

Creates a horizontal left-to-right gradient.

Parameters

startColor OfficeIMO.Drawing.OfficeColor requiredposition: 0
endColor OfficeIMO.Drawing.OfficeColor requiredposition: 1
public static OfficeLinearGradient Vertical(OfficeColor startColor, OfficeColor endColor) #
Returns: OfficeLinearGradient

Creates a vertical top-to-bottom gradient.

Parameters

startColor OfficeIMO.Drawing.OfficeColor requiredposition: 0
endColor OfficeIMO.Drawing.OfficeColor requiredposition: 1

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.