Class SVGLength

Class SVGLength

Namespace: Aspose.Html.Dom.Svg.DataTypes
Assembly: Aspose.HTML.dll (25.2.0)

The SVGLength interface corresponds to the length basic data type. An SVGLength object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown, as described below.

[ComVisible(true)]
[DOMObject]
[DOMName("SVGLength")]
public class SVGLength : SVGValueType, INotifyPropertyChanged, IDisposable

Inheritance

objectDOMObjectSVGValueTypeSVGLength

Implements

INotifyPropertyChanged, IDisposable

Inherited Members

SVGValueType.Dispose(), SVGValueType.Dispose(bool), DOMObject.GetPlatformType(), object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Fields

SVG_LENGTHTYPE_CM

A value was specified using the cm units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_CM")]
public const ushort SVG_LENGTHTYPE_CM = 6

Field Value

ushort

SVG_LENGTHTYPE_EMS

A value was specified using the em units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_EMS")]
public const ushort SVG_LENGTHTYPE_EMS = 3

Field Value

ushort

SVG_LENGTHTYPE_EXS

A value was specified using the ex units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_EXS")]
public const ushort SVG_LENGTHTYPE_EXS = 4

Field Value

ushort

SVG_LENGTHTYPE_IN

A value was specified using the in units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_IN")]
public const ushort SVG_LENGTHTYPE_IN = 8

Field Value

ushort

SVG_LENGTHTYPE_MM

A value was specified using the mm units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_MM")]
public const ushort SVG_LENGTHTYPE_MM = 7

Field Value

ushort

SVG_LENGTHTYPE_NUMBER

No unit type was provided (i.e., a unitless value was specified), which indicates a value in user units.

[DOMName("SVG_LENGTHTYPE_NUMBER")]
public const ushort SVG_LENGTHTYPE_NUMBER = 1

Field Value

ushort

SVG_LENGTHTYPE_PC

A value was specified using the pc units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_PC")]
public const ushort SVG_LENGTHTYPE_PC = 10

Field Value

ushort

SVG_LENGTHTYPE_PERCENTAGE

A percentage value was specified.

[DOMName("SVG_LENGTHTYPE_PERCENTAGE")]
public const ushort SVG_LENGTHTYPE_PERCENTAGE = 2

Field Value

ushort

SVG_LENGTHTYPE_PT

A value was specified using the pt units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_PT")]
public const ushort SVG_LENGTHTYPE_PT = 9

Field Value

ushort

SVG_LENGTHTYPE_PX

A value was specified using the px units defined in CSS2.

[DOMName("SVG_LENGTHTYPE_PX")]
public const ushort SVG_LENGTHTYPE_PX = 5

Field Value

ushort

SVG_LENGTHTYPE_UNKNOWN

The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.

[DOMName("SVG_LENGTHTYPE_UNKNOWN")]
public const ushort SVG_LENGTHTYPE_UNKNOWN = 0

Field Value

ushort

Properties

UnitType

The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.

[DOMName("unitType")]
public ushort UnitType { get; }

Property Value

ushort

Value

The value as a floating point value, in user units. Setting this attribute will cause valueInSpecifiedUnits and valueAsString to be updated automatically to reflect this setting.

[DOMName("value")]
public float Value { get; set; }

Property Value

float

Exceptions

DOMException

Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR Raised when the length corresponds to a read only attribute or when the object itself is read only.

ValueAsString

The value as a string value, in the units expressed by unitType. Setting this attribute will cause value, valueInSpecifiedUnits and unitType to be updated automatically to reflect this setting.

[DOMName("valueAsString")]
public string ValueAsString { get; set; }

Property Value

string

Exceptions

DOMException

Code Aspose.Html.Dom.DOMException.SYNTAX_ERR Raised if the assigned string cannot be parsed as a valid length.

DOMException

Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR Raised when the length corresponds to a read only attribute or when the object itself is read only.

ValueInSpecifiedUnits

The value as a floating point value, in the units expressed by unitType. Setting this attribute will cause value and valueAsString to be updated automatically to reflect this setting.

[DOMName("valueInSpecifiedUnits")]
public float ValueInSpecifiedUnits { get; set; }

Property Value

float

Exceptions

DOMException

Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR Raised when the length corresponds to a read only attribute or when the object itself is read only.

Methods

ConvertToSpecifiedUnits(ushort)

Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes unitType, valueInSpecifiedUnits and valueAsString might be modified as a result of this method. For example, if the original value were “0.5cm” and the method was invoked to convert to millimeters, then the unitType would be changed to SVG_LENGTHTYPE_MM, valueInSpecifiedUnits would be changed to the numeric value 5 and valueAsString would be changed to “5mm”.

[DOMName("convertToSpecifiedUnits")]
public void ConvertToSpecifiedUnits(ushort unitType)

Parameters

unitType ushort

The unit type to switch to (e.g., SVG_LENGTHTYPE_MM).

Exceptions

DOMException

Code Aspose.Html.Dom.DOMException.NOT_SUPPORTED_ERR Raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_* constants defined on this interface).

DOMException

Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR Raised when the length corresponds to a read only attribute or when the object itself is read only.

NewValueSpecifiedUnits(ushort, float)

Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.

[DOMName("newValueSpecifiedUnits")]
public void NewValueSpecifiedUnits(ushort unitType, float valueInSpecifiedUnits)

Parameters

unitType ushort

The unit type for the value.

valueInSpecifiedUnits float

The new value..

Exceptions

DOMException

Code Aspose.Html.Dom.DOMException.NOT_SUPPORTED_ERR Raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_* constants defined on this interface).

DOMException

Code Aspose.Html.Dom.DOMException.NO_MODIFICATION_ALLOWED_ERR Raised when the length corresponds to a read only attribute or when the object itself is read only.

ToString()

Returns a System.String that represents this instance.

public override string ToString()

Returns

string

A System.String that represents this instance.