PixelSize Struct

Summary

Represents a size in device pixels.
Namespace
Avalonia
Interfaces
Base Types
  • object
  • ValueType
graph BT Type-->Base0["ValueType"] Base0-->Base1["object"] Type-.->Interface0["IEquatable<PixelSize>"] Type["PixelSize"] class Type type-node

Syntax

public readonly struct PixelSize : ValueType, IEquatable<PixelSize>

Constructors

Name Summary
PixelSize(int, int) Initializes a new instance of the PixelSize structure.

Fields

Name Constant Value Summary
Empty
A size representing zero
static

Properties

Name Value Summary
AspectRatio double
Gets the aspect ratio of the size.
Height int
Gets the height.
Width int
Gets the width.

Methods

Name Value Summary
Equals(object) bool
Checks for equality between a size and an object.
Equals(PixelSize) bool
Returns a boolean indicating whether the size is equal to the other given size.
FromSize(Size, double) PixelSize
Converts a Size to device pixels using the specified scaling factor.
static
FromSize(Size, Vector) PixelSize
Converts a Size to device pixels using the specified scaling factor.
static
FromSizeWithDpi(Size, double) PixelSize
Converts a Size to device pixels using the specified dots per inch (DPI).
static
FromSizeWithDpi(Size, Vector) PixelSize
Converts a Size to device pixels using the specified dots per inch (DPI).
static
GetHashCode() int
Returns a hash code for a PixelSize.
Parse(string) PixelSize
Parses a PixelSize string.
static
ToSize(double) Size
Converts the PixelSize to a device-independent Size using the specified scaling factor.
ToSize(Vector) Size
Converts the PixelSize to a device-independent Size using the specified scaling factor.
ToSizeWithDpi(double) Size
Converts the PixelSize to a device-independent Size using the specified dots per inch (DPI).
ToSizeWithDpi(Vector) Size
Converts the PixelSize to a device-independent Size using the specified dots per inch (DPI).
ToString() string
Returns the string representation of the size.
WithHeight(int) PixelSize
Returns a new PixelSize with the same width and the specified height.
WithWidth(int) PixelSize
Returns a new PixelSize with the same height and the specified width.

Operators

Name Value Summary
operator !=(PixelSize, PixelSize) bool
operator ==(PixelSize, PixelSize) bool