Struct SvgUnit
Represents a unit in an Scalable Vector Graphics document.
Inherited Members
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Svg
Assembly: Svg.dll
Syntax
[TypeConverter(typeof(SvgUnitConverter))]
public struct SvgUnit
Constructors
|
Improve this Doc
View Source
SvgUnit(SvgUnitType, Single)
Initializes a new instance of the SvgUnit struct.
Declaration
public SvgUnit(SvgUnitType type, float value)
Parameters
|
Improve this Doc
View Source
SvgUnit(Single)
Initializes a new instance of the SvgUnit struct.
Declaration
public SvgUnit(float value)
Parameters
| Type |
Name |
Description |
| Single |
value |
The value.
|
Fields
|
Improve this Doc
View Source
Empty
Declaration
public static readonly SvgUnit Empty
Field Value
|
Improve this Doc
View Source
None
Gets an SvgUnit with a value of none.
Declaration
public static readonly SvgUnit None
Field Value
Properties
|
Improve this Doc
View Source
IsEmpty
Gets a value to determine whether the unit is empty.
Declaration
public readonly bool IsEmpty { get; }
Property Value
|
Improve this Doc
View Source
IsNone
Gets whether this unit is none.
Declaration
public readonly bool IsNone { get; }
Property Value
|
Improve this Doc
View Source
Type
Declaration
public readonly SvgUnitType Type { get; }
Property Value
|
Improve this Doc
View Source
Value
Gets the value of the unit.
Declaration
public readonly float Value { get; }
Property Value
Methods
|
Improve this Doc
View Source
Equals(SvgUnit)
Declaration
public bool Equals(SvgUnit other)
Parameters
| Type |
Name |
Description |
| SvgUnit |
other |
|
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| Object |
obj |
|
Returns
Overrides
|
Improve this Doc
View Source
GetDevicePoint(SvgUnit, SvgUnit, ISvgRenderer, SvgElement)
Declaration
public static PointF GetDevicePoint(SvgUnit x, SvgUnit y, ISvgRenderer renderer, SvgElement owner)
Parameters
Returns
|
Improve this Doc
View Source
GetDevicePointOffset(SvgUnit, SvgUnit, ISvgRenderer, SvgElement)
Declaration
public static PointF GetDevicePointOffset(SvgUnit x, SvgUnit y, ISvgRenderer renderer, SvgElement owner)
Parameters
Returns
|
Improve this Doc
View Source
GetDeviceSize(SvgUnit, SvgUnit, ISvgRenderer, SvgElement)
Declaration
public static SizeF GetDeviceSize(SvgUnit width, SvgUnit height, ISvgRenderer renderer, SvgElement owner)
Parameters
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Improve this Doc
View Source
ToDeviceValue(ISvgRenderer, UnitRenderingType, SvgElement)
Converts the current unit to one that can be used at render time.
Declaration
public float ToDeviceValue(ISvgRenderer renderer, UnitRenderingType renderType, SvgElement owner)
Parameters
Returns
| Type |
Description |
| Single |
The representation of the current unit in a device value (usually pixels).
|
|
Improve this Doc
View Source
ToPercentage()
Converts the current unit to a percentage, if applicable.
Declaration
public SvgUnit ToPercentage()
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
Operators
|
Improve this Doc
View Source
Equality(SvgUnit, SvgUnit)
Declaration
public static bool operator ==(SvgUnit lhs, SvgUnit rhs)
Parameters
Returns
|
Improve this Doc
View Source
Implicit(SvgUnit to Single)
Declaration
public static implicit operator float (SvgUnit value)
Parameters
| Type |
Name |
Description |
| SvgUnit |
value |
The value.
|
Returns
| Type |
Description |
| Single |
The result of the conversion.
|
|
Improve this Doc
View Source
Implicit(Single to SvgUnit)
Declaration
public static implicit operator SvgUnit(float value)
Parameters
| Type |
Name |
Description |
| Single |
value |
The value.
|
Returns
| Type |
Description |
| SvgUnit |
The result of the conversion.
|
|
Improve this Doc
View Source
Inequality(SvgUnit, SvgUnit)
Declaration
public static bool operator !=(SvgUnit lhs, SvgUnit rhs)
Parameters
Returns