PixelSize Structure

Represents a size in device pixels.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public readonly struct PixelSize : IEquatable<PixelSize>
Inheritance
Object    ValueType    PixelSize
Implements
IEquatablePixelSize

Properties

AspectRatio Gets the aspect ratio of the size.
Height Gets the height.
Width Gets the width.

Methods

Equals(Object) Checks for equality between a size and an object.
(Overrides ValueTypeEquals(Object))
Equals(PixelSize) Returns a boolean indicating whether the size is equal to the other given size.
FromSize(Size, Vector) Converts a Size to device pixels using the specified scaling factor.
FromSize(Size, Double) Converts a Size to device pixels using the specified scaling factor.
FromSizeWithDpi(Size, Vector) Converts a Size to device pixels using the specified dots per inch (DPI).
FromSizeWithDpi(Size, Double) Converts a Size to device pixels using the specified dots per inch (DPI).
GetHashCode Returns a hash code for a PixelSize.
(Overrides ValueTypeGetHashCode)
GetTypeGets the Type of the current instance.
(Inherited from Object)
Parse(String) Parses a PixelSize string.
ToSize(Double) Converts the PixelSize to a device-independent Size using the specified scaling factor.
ToSize(Vector) Converts the PixelSize to a device-independent Size using the specified scaling factor.
ToSizeWithDpi(Double) Converts the PixelSize to a device-independent Size using the specified dots per inch (DPI).
ToSizeWithDpi(Vector) Converts the PixelSize to a device-independent Size using the specified dots per inch (DPI).
ToString Returns the string representation of the size.
(Overrides ValueTypeToString)
TryParse(String, PixelSize) Try parsing source as PixelSize.
WithHeight(Int32) Returns a new PixelSize with the same width and the specified height.
WithWidth(Int32) Returns a new PixelSize with the same height and the specified width.

Operators

Equality(PixelSize, PixelSize) Checks for equality between two PixelSizes.
Inequality(PixelSize, PixelSize) Checks for inequality between two Sizes.

Fields

Empty A size representing zero

See Also