Show / Hide Table of Contents

Struct Size

Represents a size in device pixels.

Implements
IEquatable<Size>
Namespace: MarcusW.VncClient
Assembly: MarcusW.VncClient.dll
Syntax
public struct Size : IEquatable<Size>
Remarks

Based on https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Visuals/Media/PixelSize.cs

Constructors

| Improve this Doc View Source

Size(Int32, Int32)

Initializes a new instance of the Size structure.

Declaration
public Size(int width, int height)
Parameters
Type Name Description
System.Int32 width

The width.

System.Int32 height

The height.

Fields

| Improve this Doc View Source

Zero

A size representing zero.

Declaration
public static readonly Size Zero
Field Value
Type Description
Size

Properties

| Improve this Doc View Source

AspectRatio

Gets the aspect ratio of the size.

Declaration
public double AspectRatio { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Height

Gets the height.

Declaration
public int Height { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Width

Gets the width.

Declaration
public int Width { get; }
Property Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

Equals(Size)

Returns a boolean indicating whether the size is equal to the other given size.

Declaration
public bool Equals(Size other)
Parameters
Type Name Description
Size other

The other size to test equality against.

Returns
Type Description
System.Boolean

True if this size is equal to other, False otherwise.

| Improve this Doc View Source

Equals(Nullable<Object>)

Checks for equality between a size and an object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
System.Nullable<System.Object> obj

The object.

Returns
Type Description
System.Boolean

True if obj is a size that equals the current size.

| Improve this Doc View Source

GetHashCode()

Returns a hash code for a Size.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

The hash code.

| Improve this Doc View Source

ToString()

Returns the string representation of the size.

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

The string representation of the size.

| Improve this Doc View Source

WithHeight(Int32)

Returns a new Size with the same width and the specified height.

Declaration
public Size WithHeight(int height)
Parameters
Type Name Description
System.Int32 height

The height.

Returns
Type Description
Size

The new Size.

| Improve this Doc View Source

WithWidth(Int32)

Returns a new Size with the same height and the specified width.

Declaration
public Size WithWidth(int width)
Parameters
Type Name Description
System.Int32 width

The width.

Returns
Type Description
Size

The new Size.

Operators

| Improve this Doc View Source

Equality(Size, Size)

Checks for equality between two Sizes.

Declaration
public static bool operator ==(Size left, Size right)
Parameters
Type Name Description
Size left

The first size.

Size right

The second size.

Returns
Type Description
System.Boolean

True if the sizes are equal, otherwise false.

| Improve this Doc View Source

Inequality(Size, Size)

Checks for inequality between two Sizes.

Declaration
public static bool operator !=(Size left, Size right)
Parameters
Type Name Description
Size left

The first size.

Size right

The second size.

Returns
Type Description
System.Boolean

True if the sizes are unequal, otherwise false.

Implements

IEquatable<>
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX