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

Class SvgVisual

Represents an SVG element that can be rendered. It has a convex hull, a bounding box and a size

Inheritance
object
SvgElement
SvgVisual
SvgCircle
SvgLine
SvgPath
SvgPolygon
SvgPolyline
SvgRectangleAsRect
SvgText
SvgVisualContainer
Implements
IXmlSerializable
IEquatable<SvgElement>
Inherited Members
SvgElement.SvgName
SvgElement.id
SvgElement.ID
SvgElement.RootDocument
SvgElement.Root
SvgElement.Parent
SvgElement.ViewPort
SvgElement.ViewPortWidth
SvgElement.ViewPortHeight
SvgElement.GetSchema()
SvgElement.WriteXml(XmlWriter)
SvgElement.ReadXml(XmlReader)
SvgElement.ToSvgGroup()
SvgElement.ToSvgDocument()
SvgElement.Attributes()
SvgElement.Equals(object)
SvgElement.Equals(SvgElement)
SvgElement.InformedEquals(SvgElement)
SvgElement.GetHashCode()
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenSvg.SvgNodes
Assembly: OpenSvg.dll
Syntax
public abstract class SvgVisual : SvgElement, IXmlSerializable, IEquatable<SvgElement>

Fields

| Edit this page View Source

fillColor

Declaration
protected readonly ColorAttr fillColor
Field Value
Type Description
ColorAttr
| Edit this page View Source

strokeColor

Declaration
protected readonly ColorAttr strokeColor
Field Value
Type Description
ColorAttr
| Edit this page View Source

strokeWidth

Declaration
protected readonly FloatAttr strokeWidth
Field Value
Type Description
FloatAttr
| Edit this page View Source

transform

Declaration
public readonly TransformAttr transform
Field Value
Type Description
TransformAttr

Properties

| Edit this page View Source

BoundingBox

Gets the rectangular bounding box of this SvgVisual element.

Declaration
public BoundingBox BoundingBox { get; }
Property Value
Type Description
BoundingBox
Remarks

The bounding box is derived from the convex hull of the element.

| Edit this page View Source

ConvexHull

Gets the convex hull of this SvgVisual element.

Declaration
public ConvexHull ConvexHull { get; }
Property Value
Type Description
ConvexHull
Remarks

The convex hull is calculated followed by applying the current transformation of the element.

| Edit this page View Source

DrawConfig

Gets or sets the drawing configuration for this SvgVisual element.

Declaration
public DrawConfig DrawConfig { get; set; }
Property Value
Type Description
DrawConfig
Remarks

This configuration includes fill color, stroke color, and stroke width.

| Edit this page View Source

FillColor

Gets or sets the fill color of this SvgVisual element.

Declaration
public SKColor FillColor { get; set; }
Property Value
Type Description
SKColor
Remarks

The default color is Black according to the SVG 1.1 specification.

See Also
SVG 1.1 Fill Property
| Edit this page View Source

StrokeColor

Gets or sets the stroke color of this SvgVisual element.

Declaration
public SKColor StrokeColor { get; set; }
Property Value
Type Description
SKColor
Remarks

The default color is None according to the SVG 1.1 specification.

See Also
SVG 1.1 Stroke Property
| Edit this page View Source

StrokeWidth

Gets or sets the stroke-width of this SvgVisual element.

Declaration
public float StrokeWidth { get; set; }
Property Value
Type Description
float
Remarks

The default stroke-width is 1 according to the SVG 1.1 specification.

See Also
SVG 1.1 Stroke Width
| Edit this page View Source

Transform

Gets the transformation attribute of this SvgVisual element.

Declaration
public Transform Transform { get; set; }
Property Value
Type Description
Transform
Remarks

This attribute defines the transformation to be applied to the element.

Methods

| Edit this page View Source

AlignRelativeTo(SvgVisual, HorizontalAlignment?, VerticalAlignment?)

Aligns this SvgVisual element relative to a specified reference element, using the given horizontal and vertical alignment parameters.

Declaration
public void AlignRelativeTo(SvgVisual referenceElement, HorizontalAlignment? horizontalAlignment = null, VerticalAlignment? verticalAlignment = null)
Parameters
Type Name Description
SvgVisual referenceElement

The reference SvgVisual element to which this element will be aligned. It provides the frame of reference for alignment.

HorizontalAlignment? horizontalAlignment

The horizontal alignment strategy. If null, no horizontal alignment is applied. See HorizontalAlignment for detailed options.

VerticalAlignment? verticalAlignment

The vertical alignment strategy. If null, no vertical alignment is applied. See VerticalAlignment for detailed options.

Remarks

This operations moves this element. The reference element is not moved.

Exceptions
Type Condition
NotSupportedException

Thrown if an unsupported alignment is provided.

See Also
HorizontalAlignment
VerticalAlignment
| Edit this page View Source

ComputeConvexHull()

Protected method to compute the non-transformed convex hull of this SvgVisual element.

Declaration
protected abstract ConvexHull ComputeConvexHull()
Returns
Type Description
ConvexHull

Implements

IXmlSerializable
IEquatable<T>