SVGBuilderExtensions.AddFilter

AddFilter<TBuilder>(this TBuilder, CoordinateUnits?, CoordinateUnits?, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<Color, Paint, string>, OneOf<Color, Paint, string>, string, Action<SVGFilterElementBuilder>)

Adds a ‘filter’ element to the SVG builder, defining a filter effect that can be applied to SVG elements.

public static TBuilder AddFilter<TBuilder>(this TBuilder builder, 
    CoordinateUnits? filterUnits = default, CoordinateUnits? primitiveUnits = default, 
    OneOf<double, (double, LengthType)> x = null, OneOf<double, (double, LengthType)> y = null, 
    OneOf<double, (double, LengthType)> width = null, 
    OneOf<double, (double, LengthType)> height = null, OneOf<Color, Paint, string> fill = null, 
    OneOf<Color, Paint, string> stroke = null, string id = null, 
    Action<SVGFilterElementBuilder> extend = null)
    where TBuilder : ISVGElementBuilder, IFilterPrimitiveElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder, facilitating fluent API usage.
builderThe SVG builder instance to which the ‘filter’ element will be added.
filterUnitsSpecifies the coordinate system for the filter’s x, y, width, and height attributes. Optional parameter.
primitiveUnitsSpecifies the coordinate system for the attributes of the filter’s child elements. Optional parameter.
xThe x-coordinate of the filter region. Can be a double or a ValueTuple with LengthType. Optional parameter.
yThe y-coordinate of the filter region. Can be a double or a ValueTuple with LengthType. Optional parameter.
widthThe width of the filter region. Can be a double or a ValueTuple with LengthType. Optional parameter.
heightThe height of the filter region. Can be a double or a ValueTuple with LengthType. Optional parameter.
fillThe fill color or paint for the filter element. Optional parameter.
strokeThe stroke color or paint for the filter element. Optional parameter.
idThe unique identifier for the filter element. Optional parameter.
extendAn optional action to further configure the SVGFilterElementBuilder.

Return Value

The builder instance, allowing for method chaining.

See Also


AddFilter<TBuilder>(this TBuilder, Action<SVGFilterElementBuilder>)

Adds a ‘filter’ element configuration to the builder.

public static TBuilder AddFilter<TBuilder>(this TBuilder builder, 
    Action<SVGFilterElementBuilder> configure)
    where TBuilder : ISVGElementBuilder, ICompositeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder.
builderThe builder instance.
configureThe configuration action for the ‘filter’ element.

Return Value

The builder instance for chaining.

See Also