Table of Contents

Class ScaledSize

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
public class ScaledSize : IComparable, IComparable<ScaledSize>, IEquatable<ScaledSize>
Inheritance
ScaledSize
Implements
Inherited Members
Extension Methods

Constructors

ScaledSize()

public ScaledSize()

Fields

_scale

public float _scale

Field Value

float

Properties

Default

public static ScaledSize Default { get; }

Property Value

ScaledSize

HeightCut

public bool HeightCut { get; set; }

Property Value

bool

IsEmpty

public bool IsEmpty { get; }

Property Value

bool

Pixels

public SKSize Pixels { get; set; }

Property Value

SKSize

Scale

public float Scale { get; set; }

Property Value

float

Units

public SKSize Units { get; set; }

Property Value

SKSize

WidthCut

public bool WidthCut { get; set; }

Property Value

bool

Methods

Clone()

public ScaledSize Clone()

Returns

ScaledSize

CompareTo(ScaledSize)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(ScaledSize other)

Parameters

other ScaledSize

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

CompareTo(object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(object obj)

Parameters

obj object

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes obj in the sort order.
Zero This instance occurs in the same position in the sort order as obj.
Greater than zero This instance follows obj in the sort order.

Exceptions

ArgumentException

obj is not the same type as this instance.

CreateEmpty(float)

public static ScaledSize CreateEmpty(float scale)

Parameters

scale float

Returns

ScaledSize

Equals(ScaledSize)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ScaledSize other)

Parameters

other ScaledSize

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

FromPixels(SKSize, float)

public static ScaledSize FromPixels(SKSize size, float scale)

Parameters

size SKSize
scale float

Returns

ScaledSize

FromPixels(float, float, bool, bool, float)

public static ScaledSize FromPixels(float width, float height, bool widthCut, bool heighCut, float scale)

Parameters

width float
height float
widthCut bool
heighCut bool
scale float

Returns

ScaledSize

FromPixels(float, float, float)

public static ScaledSize FromPixels(float width, float height, float scale)

Parameters

width float
height float
scale float

Returns

ScaledSize

FromUnits(float, float, float)

public static ScaledSize FromUnits(float width, float height, float scale)

Parameters

width float
height float
scale float

Returns

ScaledSize

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

SnapToPixel(double, double)

public static float SnapToPixel(double point, double scale)

Parameters

point double
scale double

Returns

float

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

WithCut(bool, bool)

public ScaledSize WithCut(bool widthCut, bool heightCut)

Parameters

widthCut bool
heightCut bool

Returns

ScaledSize

Operators

operator ==(ScaledSize, ScaledSize)

public static bool operator ==(ScaledSize left, ScaledSize right)

Parameters

left ScaledSize
right ScaledSize

Returns

bool

operator !=(ScaledSize, ScaledSize)

public static bool operator !=(ScaledSize left, ScaledSize right)

Parameters

left ScaledSize
right ScaledSize

Returns

bool