SVGBuilderExtensions.AddRect

AddRect<TBuilder>(this TBuilder, 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<SVGRectElementBuilder>)

Adds a ‘rect’ (rectangle) element with specified dimensions and styles to the SVG builder.

public static TBuilder AddRect<TBuilder>(this TBuilder builder, 
    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<SVGRectElementBuilder> extend = null)
    where TBuilder : ISVGElementBuilder, IShapeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder, facilitating fluent API usage.
builderThe SVG builder instance to which the ‘rect’ element will be added.
xThe x-coordinate of the rectangle’s starting point. Can be a double value or a tuple of double and LengthType.
yThe y-coordinate of the rectangle’s starting point. Can be a double value or a tuple of double and LengthType.
widthThe width of the rectangle. Can be a double value or a tuple of double and LengthType.
heightThe height of the rectangle. Can be a double value or a tuple of double and LengthType.
fillThe fill color or paint style for the rectangle. Can be a Color or a Paint enum value or paint server ID. Optional parameter.
strokeThe stroke color or paint style for the rectangle’s outline. Can be a Color or a Paint enum value or paint server ID. Optional parameter.
idThe unique identifier for the rectangle element. Optional parameter.
extendAn optional action to further configure the rectangle element builder.

Return Value

The builder instance, allowing for method chaining.

See Also


AddRect<TBuilder>(this TBuilder, Action<SVGRectElementBuilder>)

Adds a ‘rect’ element configuration to the builder.

public static TBuilder AddRect<TBuilder>(this TBuilder builder, 
    Action<SVGRectElementBuilder> configure)
    where TBuilder : ISVGElementBuilder, IShapeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder.
builderThe builder instance.
configureThe configuration action for the ‘rect’ element.

Return Value

The builder instance for chaining.

See Also