SvgAngle Class

https://svgwg.org/svg2-draft/types.html#InterfaceSVGAngle

public sealed class SvgAngle

Properties

NameDescription
UnitTypeGets the type of the unit of the angle, one of the SVG_ANGLETYPE_* constants.
ValueGets or sets the value of the angle, in degrees.
ValueAsStringGets or sets the serialized angle, e.g. 45deg; setting an invalid angle throws a SyntaxError.
ValueInSpecifiedUnitsGets or sets the value of the angle in its own unit.

UnitType

SvgValues.cs

Gets the type of the unit of the angle, one of the SVG_ANGLETYPE_* constants.

public ushort UnitType { get; }

Gets or sets the value of the angle, in degrees.

public float Value { get; set; }

ValueAsString

SvgValues.cs

Gets or sets the serialized angle, e.g. 45deg; setting an invalid angle throws a SyntaxError.

public string ValueAsString { get; set; }

ValueInSpecifiedUnits

SvgValues.cs

Gets or sets the value of the angle in its own unit.

public float ValueInSpecifiedUnits { get; set; }

Methods

NameDescription
ConvertToSpecifiedUnits(ushort)Converts the value of the angle to the given unit type, preserving the angle.
NewValueSpecifiedUnits(ushort, float)Sets the unit type and the value in that unit of the angle.

ConvertToSpecifiedUnits(ushort)

SvgValues.cs

Converts the value of the angle to the given unit type, preserving the angle.

public void ConvertToSpecifiedUnits(ushort unitType)

NewValueSpecifiedUnits(ushort, float)

SvgValues.cs

Sets the unit type and the value in that unit of the angle.

public void NewValueSpecifiedUnits(ushort unitType, float valueInSpecifiedUnits)

Constants

NameDescription
SvgAngleTypeDegAn angle in degrees.
SvgAngleTypeGradAn angle in gradians.
SvgAngleTypeRadAn angle in radians.
SvgAngleTypeUnknownThe unit is not one of the predefined units.
SvgAngleTypeUnspecifiedAn angle without unit, in degrees.

SvgAngleTypeDeg

An angle in degrees.

public const ushort SvgAngleTypeDeg = 2

SvgAngleTypeGrad

An angle in gradians.

public const ushort SvgAngleTypeGrad = 4

SvgAngleTypeRad

An angle in radians.

public const ushort SvgAngleTypeRad = 3

SvgAngleTypeUnknown

The unit is not one of the predefined units.

public const ushort SvgAngleTypeUnknown = 0

SvgAngleTypeUnspecified

An angle without unit, in degrees.

public const ushort SvgAngleTypeUnspecified = 1