Struct Size
Represents a size in device pixels.
Implements
Namespace: MarcusW.VncClient
Assembly: MarcusW.VncClient.dll
Syntax
public struct Size : IEquatable<Size>
Remarks
Constructors
| Improve this Doc View SourceSize(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 SourceZero
A size representing zero.
Declaration
public static readonly Size Zero
Field Value
Type | Description |
---|---|
Size |
Properties
| Improve this Doc View SourceAspectRatio
Gets the aspect ratio of the size.
Declaration
public double AspectRatio { get; }
Property Value
Type | Description |
---|---|
System.Double |
Height
Gets the height.
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Width
Gets the width.
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceEquals(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. |
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 |
GetHashCode()
Returns a hash code for a Size.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code. |
ToString()
Returns the string representation of the size.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The string representation of the size. |
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. |
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 SourceEquality(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. |
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. |