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
GradientTransform
public SvgTransformCollection GradientTransform { get; set; }
Property Value
GradientUnits
Gets or sets the coordinate system of the gradient.
public SvgCoordinateUnits GradientUnits { get; set; }
Property Value
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
SpreadMethod
Specifies what happens if the gradient starts or ends inside the bounds of the target rectangle.
public SvgGradientSpreadMethod SpreadMethod { get; set; }
Property Value
StopColor
Gets or sets the colour of the gradient stop.
[TypeConverter(typeof(SvgPaintServerFactory))]
public SvgPaintServer StopColor { get; set; }
Property Value
StopOpacity
Gets or sets the opacity of the gradient stop (0-1).
public float StopOpacity { get; set; }
Property Value
Stops
Gets the ramp of colors to use on a gradient.
public List<SvgGradientStop> Stops { get; }
Property Value
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
SvgElementThe SvgElement that has been added.
index
intAn int representing the index where the element was added to the collection.
CalculateDistance(PointF, PointF)
protected static double CalculateDistance(PointF first, PointF second)
Parameters
Returns
CalculateLength(PointF)
protected static float CalculateLength(PointF vector)
Parameters
vector
PointF
Returns
CreateBrush(SvgVisualElement, ISvgRenderer, float, bool)
protected abstract Brush CreateBrush(SvgVisualElement renderingElement, ISvgRenderer renderer, float opacity, bool forStroke)
Parameters
renderingElement
SvgVisualElementrenderer
ISvgRendereropacity
floatforStroke
bool
Returns
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
SvgVisualElementThe owner SvgVisualElement.
renderer
ISvgRendererThe renderer object.
opacity
floatThe opacity of the brush.
forStroke
boolNot used.
Returns
GetColorBlend(ISvgRenderer, float, bool)
Gets a ColorBlend representing the SvgGradientServer's gradient stops.
protected ColorBlend GetColorBlend(ISvgRenderer renderer, float opacity, bool radial)
Parameters
renderer
ISvgRendererThe renderer ISvgRenderer.
opacity
floatThe opacity of the colour blend.
radial
boolTrue if it's a radial gradiant.
Returns
NormalizeUnit(SvgUnit)
protected SvgUnit NormalizeUnit(SvgUnit orig)
Parameters
orig
SvgUnit
Returns
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
SvgElementThe SvgElement that has been removed.