Search Results for

    Show / Hide Table of Contents

    Struct SvgUnit

    Represents a unit in an Scalable Vector Graphics document.

    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    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
    Type Name Description
    SvgUnitType type

    The type.

    Single value

    The value.

    | 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

    Gets and empty SvgUnit.

    Declaration
    public static readonly SvgUnit Empty
    Field Value
    Type Description
    SvgUnit
    | Improve this Doc View Source

    None

    Gets an SvgUnit with a value of none.

    Declaration
    public static readonly SvgUnit None
    Field Value
    Type Description
    SvgUnit

    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
    Type Description
    Boolean
    | Improve this Doc View Source

    IsNone

    Gets whether this unit is none.

    Declaration
    public readonly bool IsNone { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Type

    Gets the SvgUnitType of unit.

    Declaration
    public readonly SvgUnitType Type { get; }
    Property Value
    Type Description
    SvgUnitType
    | Improve this Doc View Source

    Value

    Gets the value of the unit.

    Declaration
    public readonly float Value { get; }
    Property Value
    Type Description
    Single

    Methods

    | Improve this Doc View Source

    Equals(SvgUnit)

    Declaration
    public bool Equals(SvgUnit other)
    Parameters
    Type Name Description
    SvgUnit other
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)
    | Improve this Doc View Source

    GetDevicePoint(SvgUnit, SvgUnit, ISvgRenderer, SvgElement)

    Declaration
    public static PointF GetDevicePoint(SvgUnit x, SvgUnit y, ISvgRenderer renderer, SvgElement owner)
    Parameters
    Type Name Description
    SvgUnit x
    SvgUnit y
    ISvgRenderer renderer
    SvgElement owner
    Returns
    Type Description
    PointF
    | Improve this Doc View Source

    GetDevicePointOffset(SvgUnit, SvgUnit, ISvgRenderer, SvgElement)

    Declaration
    public static PointF GetDevicePointOffset(SvgUnit x, SvgUnit y, ISvgRenderer renderer, SvgElement owner)
    Parameters
    Type Name Description
    SvgUnit x
    SvgUnit y
    ISvgRenderer renderer
    SvgElement owner
    Returns
    Type Description
    PointF
    | Improve this Doc View Source

    GetDeviceSize(SvgUnit, SvgUnit, ISvgRenderer, SvgElement)

    Declaration
    public static SizeF GetDeviceSize(SvgUnit width, SvgUnit height, ISvgRenderer renderer, SvgElement owner)
    Parameters
    Type Name Description
    SvgUnit width
    SvgUnit height
    ISvgRenderer renderer
    SvgElement owner
    Returns
    Type Description
    SizeF
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()
    | 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
    Type Name Description
    ISvgRenderer renderer
    UnitRenderingType renderType
    SvgElement owner
    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
    Type Description
    SvgUnit

    An SvgUnit of type Percentage.

    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    ValueType.ToString()

    Operators

    | Improve this Doc View Source

    Equality(SvgUnit, SvgUnit)

    Declaration
    public static bool operator ==(SvgUnit lhs, SvgUnit rhs)
    Parameters
    Type Name Description
    SvgUnit lhs
    SvgUnit rhs
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Implicit(SvgUnit to Single)

    Performs an implicit conversion from 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)

    Performs an implicit conversion from 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
    Type Name Description
    SvgUnit lhs
    SvgUnit rhs
    Returns
    Type Description
    Boolean
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX