Skip to main content

PixelVector Struct

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Defines a vector.

public struct PixelVector

Inheritance: ValueType -> PixelVector

Constructors

NameDescription
PixelVectorInitializes a new instance of the Avalonia.PixelVector structure.

PixelVector Constructor

Initializes a new instance of the Avalonia.PixelVector structure.

public PixelVector(int x, int y)

Parameters

x int

The X vector.

y int

The Y vector.

Methods

NameDescription
Equals (2 overloads)Check if two vectors are equal (bitwise).
GetHashCodeNo summary available.
NearlyEqualsCheck if two vectors are nearly equal (numerically).
ToStringReturns the string representation of the point.
WithXReturns a new vector with the specified X coordinate.
WithYReturns a new vector with the specified Y coordinate.

Equals overloads

Equals Method

Check if two vectors are equal (bitwise).

public bool Equals(Avalonia.PixelVector other)
Parameters

other Avalonia.PixelVector

Returns

bool

Equals Method

public bool Equals(object obj)
Parameters

obj object

Returns

bool

GetHashCode Method

public int GetHashCode()

Returns

int

NearlyEquals Method

Check if two vectors are nearly equal (numerically).

public bool NearlyEquals(Avalonia.PixelVector other)

Parameters

other Avalonia.PixelVector

The other vector.

Returns

bool

True if vectors are nearly equal.

ToString Method

Returns the string representation of the point.

public string ToString()

Returns

string

The string representation of the point.

WithX Method

Returns a new vector with the specified X coordinate.

public Avalonia.PixelVector WithX(int x)

Parameters

x int

The X coordinate.

Returns

Avalonia.PixelVector

The new vector.

WithY Method

Returns a new vector with the specified Y coordinate.

public Avalonia.PixelVector WithY(int y)

Parameters

y int

The Y coordinate.

Returns

Avalonia.PixelVector

The new vector.

Properties

NameDescription
LengthLength of the vector
XGets the X vector.
YGets the Y vector.

Length Property

Length of the vector

public double Length { get; set; }

X Property

Gets the X vector.

public int X { get; set; }

Y Property

Gets the Y vector.

public int Y { get; set; }