SVGBuilderExtensions.AddImage

AddImage<TBuilder>(this TBuilder, string, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, string, Action<SVGImageElementBuilder>)

Adds an ‘image’ element to the SVG builder, embedding an external image into the SVG document.

public static TBuilder AddImage<TBuilder>(this TBuilder builder, string href = null, 
    OneOf<double, (double, LengthType)> x = null, OneOf<double, (double, LengthType)> y = null, 
    OneOf<double, (double, LengthType)> width = null, 
    OneOf<double, (double, LengthType)> height = null, string id = null, 
    Action<SVGImageElementBuilder> extend = null)
    where TBuilder : ISVGElementBuilder, ICompositeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder, facilitating fluent API usage.
builderThe SVG builder instance to which the ‘image’ element will be added.
hrefThe URL or reference to the external image. Optional parameter.
xThe x-coordinate where the image is placed. Can be a double or a ValueTuple with LengthType. Optional parameter.
yThe y-coordinate where the image is placed. Can be a double or a ValueTuple with LengthType. Optional parameter.
widthThe width of the image. Can be a double or a ValueTuple with LengthType. Optional parameter.
heightThe height of the image. Can be a double or a ValueTuple with LengthType. Optional parameter.
idThe unique identifier for the image element. Optional parameter.
extendAn optional action to further configure the SVGImageElementBuilder.

Return Value

The builder instance, allowing for method chaining.

See Also


AddImage<TBuilder>(this TBuilder, Action<SVGImageElementBuilder>)

Adds an ‘image’ element configuration to the builder.

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

Return Value

The builder instance for chaining.

See Also