Class SvgVisual
Represents an SVG element that can be rendered. It has a convex hull, a bounding box and a size
Inheritance
Inherited Members
Namespace: OpenSvg.SvgNodes
Assembly: OpenSvg.dll
Syntax
public abstract class SvgVisual : SvgElement, IXmlSerializable, IEquatable<SvgElement>
Fields
| Edit this page View SourcefillColor
Declaration
protected readonly ColorAttr fillColor
Field Value
Type | Description |
---|---|
ColorAttr |
strokeColor
Declaration
protected readonly ColorAttr strokeColor
Field Value
Type | Description |
---|---|
ColorAttr |
strokeWidth
Declaration
protected readonly FloatAttr strokeWidth
Field Value
Type | Description |
---|---|
FloatAttr |
transform
Declaration
public readonly TransformAttr transform
Field Value
Type | Description |
---|---|
TransformAttr |
Properties
| Edit this page View SourceBoundingBox
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.
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.
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.
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
| Edit this page View SourceStrokeColor
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
| Edit this page View SourceStrokeWidth
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
| Edit this page View SourceTransform
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 SourceAlignRelativeTo(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
| Edit this page View SourceComputeConvexHull()
Protected method to compute the non-transformed convex hull of this SvgVisual element.
Declaration
protected abstract ConvexHull ComputeConvexHull()
Returns
Type | Description |
---|---|
ConvexHull |