Back to top OpenSVG (c) Veridict AB, www.veridict.com
Edit this page

Class RectangleConfig

Defining attributes of a rectangle in SVG The rectangle can be rendered either as a 'polygon' or a high-level 'rect' in SVG.

Inheritance
object
RectangleConfig
Implements
IEquatable<RectangleConfig>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenSvg.Config
Assembly: OpenSvg.dll
Syntax
public record RectangleConfig : IEquatable<RectangleConfig>
Remarks

When converting to GeoJSON rectangles must be drwawn as SvgPolygon

Constructors

| Edit this page View Source

RectangleConfig(Size, DrawConfig, int, float)

Defining attributes of a rectangle in SVG The rectangle can be rendered either as a 'polygon' or a high-level 'rect' in SVG.

Declaration
public RectangleConfig(Size Size, DrawConfig DrawConfig, int NumberOfCornerPoints = 10, float CornerRadius = 0)
Parameters
Type Name Description
Size Size

Size of the rectangle

DrawConfig DrawConfig

Styling options for the rectangle

int NumberOfCornerPoints

Number of points used to approximate curved corners, when the rectangle is drawn as a polygon

float CornerRadius

Defines the circle radius of the corners. If CornerRadius=0 there will be no rounding corners, but just normal square corners

Remarks

When converting to GeoJSON rectangles must be drwawn as SvgPolygon

Properties

| Edit this page View Source

CornerRadius

Defines the circle radius of the corners. If CornerRadius=0 there will be no rounding corners, but just normal square corners

Declaration
public float CornerRadius { get; init; }
Property Value
Type Description
float
| Edit this page View Source

DrawConfig

Styling options for the rectangle

Declaration
public DrawConfig DrawConfig { get; init; }
Property Value
Type Description
DrawConfig
| Edit this page View Source

NumberOfCornerPoints

Number of points used to approximate curved corners, when the rectangle is drawn as a polygon

Declaration
public int NumberOfCornerPoints { get; init; }
Property Value
Type Description
int
| Edit this page View Source

Size

Size of the rectangle

Declaration
public Size Size { get; init; }
Property Value
Type Description
Size

Methods

| Edit this page View Source

ToPolygon()

Creates a polygon from the rectangle config

Declaration
public Polygon ToPolygon()
Returns
Type Description
Polygon
| Edit this page View Source

ToSvgPolygon()

Creates a SvgPolygon element from this RectangleConfig"/>

Declaration
public SvgPolygon ToSvgPolygon()
Returns
Type Description
SvgPolygon
| Edit this page View Source

ToSvgRect()

Convert to SVG Rectangle object

Declaration
public SvgRectangleAsRect ToSvgRect()
Returns
Type Description
SvgRectangleAsRect
| Edit this page View Source

Transparent(Size)

Gets a transparent RectangleConfig instance. This is useful for creating invisible spaces between shapes.

Declaration
public static RectangleConfig Transparent(Size size)
Parameters
Type Name Description
Size size

Size of the rectangle.

Returns
Type Description
RectangleConfig

A new instance of the RectangleConfig with transparent DrawConfig.

| Edit this page View Source

WithFillColor(SKColor)

Returns a new copy of the RectangleConfig record with the specified fill color.

Declaration
public RectangleConfig WithFillColor(SKColor fillColor)
Parameters
Type Name Description
SKColor fillColor

The new fill color to set.

Returns
Type Description
RectangleConfig

A new RectangleConfig with the specified fill color.

| Edit this page View Source

WithStrokeColor(SKColor)

Returns a new copy of the RectangleConfig record with the specified stroke color.

Declaration
public RectangleConfig WithStrokeColor(SKColor strokeColor)
Parameters
Type Name Description
SKColor strokeColor

The new stroke color to set.

Returns
Type Description
RectangleConfig

A new RectangleConfig with the specified stroke color.

Implements

IEquatable<T>