Class GradientPaint

GoDiagram®
v10.0.8
by Northwoods Software®

A GradientPaint holds information describing how to draw a linear or radial gradient. GradientPaints are immutable.

Implements
Namespace: Northwoods.Go
Assembly: Northwoods.GoDiagram.WinForms.dll
Syntax
public abstract class GradientPaint : Paint, ICloneable

Constructors

GradientPaint(GradientPaint)

Costructs a copy of the given GradientPaint.

Declaration
public GradientPaint(GradientPaint p)
Parameters
Type Name Description
GradientPaint p

the GradientPaint to copy from

GradientPaint(IDictionary<float, string>, Spot, Spot)

Constructs a GradientPaint with the given stops and start and end Spots.

Declaration
public GradientPaint(IDictionary<float, string> stops, Spot start, Spot end)
Parameters
Type Name Description
IDictionary<float, string> stops

a dictionary mapping fractional stops to color strings

Spot start

the starting spot for the gradient

Spot end

the ending spot for the gradient

GradientPaint(IDictionary<float, string>)

Constructs a GradientPaint with the given stops.

Declaration
public GradientPaint(IDictionary<float, string> stops)
Parameters
Type Name Description
IDictionary<float, string> stops

a dictionary mapping fractional stops to color strings

GradientPaint((float, string)[], Spot, Spot)

Constructs a GradientPaint with the given stops and start and end Spots.

Declaration
public GradientPaint((float, string)[] stops, Spot start, Spot end)
Parameters
Type Name Description
(float, string)[] stops

an array of tuples mapping fractional stops to color strings

Spot start

the starting spot for the gradient

Spot end

the ending spot for the gradient

GradientPaint((float, string)[])

Constructs a GradientPaint with the given stops.

Declaration
public GradientPaint((float, string)[] stops)
Parameters
Type Name Description
(float, string)[] stops

an array of tuples mapping fractional stops to color strings

Properties

ColorStops

This read-only property returns an immutable dictionary holding all of the color stops used in this gradient, where the key is a number, the fractional distance between 0 and 1 (inclusive), and where the corresponding value is a color string.

Declaration
public ImmutableDictionary<float, string> ColorStops { get; }
Property Value
Type Description
ImmutableDictionary<float, string>
Remarks

If you need to add a color stop, you should construct a new gradient.

End

This read-only property returns the ending location for a linear or radial gradient.

Declaration
public Spot End { get; }
Property Value
Type Description
Spot
Remarks

A Spot value specifies a relative point in the object's NaturalBounds. The default value is Bottom for linear gradients and Center for radial gradients.

This field is ignored in WinForms.

Start

This read-only property returns the starting location for a gradient.

Declaration
public Spot Start { get; }
Property Value
Type Description
Spot
Remarks

A Spot value specifies a relative point in the object's NaturalBounds. The default value is Top for linear gradients and Center for radial gradients.

Implements