PixelSize Structure
Represents a size in device pixels.
Definition
Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public readonly struct PixelSize : IEquatable<PixelSize>
Public Structure PixelSize
Implements IEquatable(Of PixelSize)
[<SealedAttribute>]
type PixelSize =
struct
inherit ValueType
interface IEquatable<PixelSize>
end
Inheritance | Object → ValueType → PixelSize |
Implements | IEquatable(PixelSize) |
Constructors
PixelSize(Int32, Int32) | Initializes a new instance of the PixelSize structure. |
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 ValueType.Equals(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 ValueType.GetHashCode()) |
GetType() | Gets 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 ValueType.ToString()) |
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 |