Table of Contents

Class SvgGradientServer

Namespace
Svg
Assembly
Svg.dll

Provides the base class for all paint servers that wish to render a gradient.

public abstract class SvgGradientServer : SvgPaintServer, ISvgTransformable, ICloneable, ISvgNode
Inheritance
SvgGradientServer
Implements
Derived
Inherited Members
Extension Methods

Properties

EffectiveGradientTransform

protected Matrix EffectiveGradientTransform { get; }

Property Value

Matrix

GradientTransform

public SvgTransformCollection GradientTransform { get; set; }

Property Value

SvgTransformCollection

GradientUnits

Gets or sets the coordinate system of the gradient.

public SvgCoordinateUnits GradientUnits { get; set; }

Property Value

SvgCoordinateUnits

InheritGradient

Gets or sets another gradient fill from which to inherit the stops from.

[SvgAttribute("href", "http://www.w3.org/1999/xlink")]
public SvgDeferredPaintServer InheritGradient { get; set; }

Property Value

SvgDeferredPaintServer

SpreadMethod

Specifies what happens if the gradient starts or ends inside the bounds of the target rectangle.

public SvgGradientSpreadMethod SpreadMethod { get; set; }

Property Value

SvgGradientSpreadMethod

StopColor

Gets or sets the colour of the gradient stop.

[TypeConverter(typeof(SvgPaintServerFactory))]
public SvgPaintServer StopColor { get; set; }

Property Value

SvgPaintServer

StopOpacity

Gets or sets the opacity of the gradient stop (0-1).

public float StopOpacity { get; set; }

Property Value

float

Stops

Gets the ramp of colors to use on a gradient.

public List<SvgGradientStop> Stops { get; }

Property Value

List<SvgGradientStop>

Methods

AddElement(SvgElement, int)

Called by the underlying SvgElement when an element has been added to the 'Children' collection.

protected override void AddElement(SvgElement child, int index)

Parameters

child SvgElement

The SvgElement that has been added.

index int

An int representing the index where the element was added to the collection.

CalculateDistance(PointF, PointF)

protected static double CalculateDistance(PointF first, PointF second)

Parameters

first PointF
second PointF

Returns

double

CalculateLength(PointF)

protected static float CalculateLength(PointF vector)

Parameters

vector PointF

Returns

float

CreateBrush(SvgVisualElement, ISvgRenderer, float, bool)

protected abstract Brush CreateBrush(SvgVisualElement renderingElement, ISvgRenderer renderer, float opacity, bool forStroke)

Parameters

renderingElement SvgVisualElement
renderer ISvgRenderer
opacity float
forStroke bool

Returns

Brush

GetBrush(SvgVisualElement, ISvgRenderer, float, bool)

Gets a Brush representing the current paint server.

public override Brush GetBrush(SvgVisualElement styleOwner, ISvgRenderer renderer, float opacity, bool forStroke = false)

Parameters

styleOwner SvgVisualElement

The owner SvgVisualElement.

renderer ISvgRenderer

The renderer object.

opacity float

The opacity of the brush.

forStroke bool

Not used.

Returns

Brush

GetColorBlend(ISvgRenderer, float, bool)

Gets a ColorBlend representing the SvgGradientServer's gradient stops.

protected ColorBlend GetColorBlend(ISvgRenderer renderer, float opacity, bool radial)

Parameters

renderer ISvgRenderer

The renderer ISvgRenderer.

opacity float

The opacity of the colour blend.

radial bool

True if it's a radial gradiant.

Returns

ColorBlend

NormalizeUnit(SvgUnit)

protected SvgUnit NormalizeUnit(SvgUnit orig)

Parameters

orig SvgUnit

Returns

SvgUnit

RemoveElement(SvgElement)

Called by the underlying SvgElement when an element has been removed from the 'Children' collection.

protected override void RemoveElement(SvgElement child)

Parameters

child SvgElement

The SvgElement that has been removed.