LinearGradientLayout

LinearGradientLayout

Overview

LinearGradientLayout is a class in Aspose.PDF FOSS for .NET.

A linear gradient laid out as an axial shading, with CSS colour-stop rules: the axis to paint along (Coords), the part of the vector it covers (Domain, 0 at the vector’s start, 1 at its end) and the colour pieces over it (Segments).

This class declares 3 methods for LinearGradientLayout objects in .NET programs. Available methods include: Compute, CoordinatesForDomain, CoveringDomain. Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Coords, Domain, FunctionDomain, Segments.

Properties

NameTypeAccessDescription
Coordsdouble[]ReadThe axis: x0 y0 x1 y1.
Domaindouble[]ReadWhere the axis starts and ends, as fractions of the gradient vector.
SegmentsIReadOnlyList<LinearGradientSegment>ReadGets the segments.
FunctionDomaindouble[]ReadFrom the start of the first piece to the end of the last.

Methods

SignatureDescription
Compute(x0: double, y0: double, x1: double, y1: double, stops: IReadOnlyList<GradientStopSpec>, spread: GradientSpread, cover: double[]?)Lays the gradient out, or answers null where there is nothing to paint.
CoveringDomain(x0: double, y0: double, x1: double, y1: double, cover: double[]?)The part of the vector (x0, y0)-(x1, y1) the area left, bottom, right, top projects onto, as fractions of it: [0 1] for no area.
CoordinatesForDomain(domain: double[], x0: double, y0: double, x1: double, y1: double)The axis that runs over domain of the vector: its start moved to domain[0] and its end to domain[1].

See Also