SvgLength Class
https://svgwg.org/svg2-draft/types.html#InterfaceSVGLength
public sealed class SvgLengthProperties
| Name | Description |
|---|---|
| UnitType | Gets the type of the unit of the length, one of the SVG_LENGTHTYPE_* constants. |
| Value | https://svgwg.org/svg2-draft/types.html#__svg__SVGLength__value |
| ValueAsString | Gets or sets the serialized length, e.g. 10px; setting an invalid length throws a SyntaxError. |
| ValueInSpecifiedUnits | Gets or sets the value of the length in its own unit. |
UnitType
SvgValues.csGets the type of the unit of the length, one of the SVG_LENGTHTYPE_* constants.
public ushort UnitType { get; }Property value
See also
Value
SvgValues.cshttps://svgwg.org/svg2-draft/types.html#__svg__SVGLength__value
public float Value { get; set; }Property value
See also
ValueAsString
SvgValues.csGets or sets the serialized length, e.g. 10px; setting an invalid length throws a SyntaxError.
public string ValueAsString { get; set; }Property value
See also
ValueInSpecifiedUnits
SvgValues.csGets or sets the value of the length in its own unit.
public float ValueInSpecifiedUnits { get; set; }Methods
| Name | Description |
|---|---|
| ConvertToSpecifiedUnits(ushort) | https://svgwg.org/svg2-draft/types.html#__svg__SVGLength__convertToSpecifiedUnits |
| NewValueSpecifiedUnits(ushort, float) | https://svgwg.org/svg2-draft/types.html#__svg__SVGLength__newValueSpecifiedUnits |
ConvertToSpecifiedUnits(ushort)
SvgValues.cshttps://svgwg.org/svg2-draft/types.html#__svg__SVGLength__convertToSpecifiedUnits
NewValueSpecifiedUnits(ushort, float)
SvgValues.cshttps://svgwg.org/svg2-draft/types.html#__svg__SVGLength__newValueSpecifiedUnits
Parameters
See also
Constants
| Name | Description |
|---|---|
| SvgLengthTypeCm | A length in cm. |
| SvgLengthTypeEms | A length in em. |
| SvgLengthTypeExs | A length in ex. |
| SvgLengthTypeIn | A length in in. |
| SvgLengthTypeMm | A length in mm. |
| SvgLengthTypeNumber | A number without unit, in user units. |
| SvgLengthTypePc | A length in pc. |
| SvgLengthTypePercentage | A percentage. |
| SvgLengthTypePt | A length in pt. |
| SvgLengthTypePx | A length in px. |
| SvgLengthTypeUnknown | The unit is not one of the predefined units. |
SvgLengthTypeCm
A length in cm.
public const ushort SvgLengthTypeCm = 6SvgLengthTypeEms
A length in em.
public const ushort SvgLengthTypeEms = 3SvgLengthTypeExs
A length in ex.
public const ushort SvgLengthTypeExs = 4SvgLengthTypeIn
A length in in.
public const ushort SvgLengthTypeIn = 8SvgLengthTypeMm
A length in mm.
public const ushort SvgLengthTypeMm = 7SvgLengthTypeNumber
A number without unit, in user units.
public const ushort SvgLengthTypeNumber = 1SvgLengthTypePc
A length in pc.
public const ushort SvgLengthTypePc = 10SvgLengthTypePercentage
A percentage.
public const ushort SvgLengthTypePercentage = 2SvgLengthTypePt
A length in pt.
public const ushort SvgLengthTypePt = 9SvgLengthTypePx
A length in px.
public const ushort SvgLengthTypePx = 5SvgLengthTypeUnknown
The unit is not one of the predefined units.
public const ushort SvgLengthTypeUnknown = 0