Table of Contents

Class ImmutableGradientBrush

Namespace
Avalonia.Media.Immutable
Assembly
Avalonia.Base.dll

A brush that draws with a gradient.

public abstract class ImmutableGradientBrush : IGradientBrush, IImmutableBrush, IBrush
Inheritance
ImmutableGradientBrush
Implements
Derived
Inherited Members
Extension Methods

Constructors

ImmutableGradientBrush(GradientBrush)

Initializes a new instance of the ImmutableGradientBrush class.

protected ImmutableGradientBrush(GradientBrush source)

Parameters

source GradientBrush

The brush from which this brush's properties should be copied.

ImmutableGradientBrush(IReadOnlyList<ImmutableGradientStop>, double, ImmutableTransform?, RelativePoint?, GradientSpreadMethod)

Initializes a new instance of the ImmutableGradientBrush class.

protected ImmutableGradientBrush(IReadOnlyList<ImmutableGradientStop> gradientStops, double opacity, ImmutableTransform? transform, RelativePoint? transformOrigin, GradientSpreadMethod spreadMethod)

Parameters

gradientStops IReadOnlyList<ImmutableGradientStop>

The gradient stops.

opacity double

The opacity of the brush.

transform ImmutableTransform

The transform of the brush.

transformOrigin RelativePoint?

The transform origin of the brush

spreadMethod GradientSpreadMethod

The spread method.

Properties

GradientStops

Gets the brush's gradient stops.

public IReadOnlyList<IGradientStop> GradientStops { get; }

Property Value

IReadOnlyList<IGradientStop>

Opacity

Gets the opacity of the brush.

public double Opacity { get; }

Property Value

double

SpreadMethod

Gets the brush's spread method that defines how to draw a gradient that doesn't fill the bounds of the destination control.

public GradientSpreadMethod SpreadMethod { get; }

Property Value

GradientSpreadMethod

Transform

Gets the transform of the brush.

public ITransform? Transform { get; }

Property Value

ITransform

TransformOrigin

Gets the transform origin of the brush

public RelativePoint TransformOrigin { get; }

Property Value

RelativePoint