Skip to main content

PixelPoint Struct

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Represents a point in device pixels.

public struct PixelPoint

Inheritance: ValueType -> PixelPoint

Implements: IEquatable<PixelPoint>

Constructors

NameDescription
PixelPointInitializes a new instance of the Avalonia.PixelPoint structure.

PixelPoint Constructor

Initializes a new instance of the Avalonia.PixelPoint structure.

public PixelPoint(int x, int y)

Parameters

x int

The X co-ordinate.

y int

The Y co-ordinate.

Methods

NameDescription
Equals (2 overloads)Returns a boolean indicating whether the point is equal to the other given point.
FromPoint (2 overloads)Converts a Avalonia.Point to device pixels using the specified scaling factor.
FromPointWithDpi (2 overloads)Converts a Avalonia.Point to device pixels using the specified dots per inch (DPI).
GetHashCodeReturns a hash code for a Avalonia.PixelPoint.
ParseParses a Avalonia.PixelPoint string.
ToPoint (2 overloads)Converts the Avalonia.PixelPoint to a device-independent Avalonia.Point using the specified scaling factor.
ToPointWithDpi (2 overloads)Converts the Avalonia.PixelPoint to a device-independent Avalonia.Point using the specified dots per inch (DPI).
ToStringReturns the string representation of the point.
WithXReturns a new Avalonia.PixelPoint with the same Y co-ordinate and the specified X co-ordinate.
WithYReturns a new Avalonia.PixelPoint with the same X co-ordinate and the specified Y co-ordinate.

Equals overloads

Equals Method

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

public bool Equals(Avalonia.PixelPoint other)
Parameters

other Avalonia.PixelPoint

The other point to test equality against.

Returns

bool

True if this point is equal to other; False otherwise.

Equals Method

Checks for equality between a point and an object.

public bool Equals(object obj)
Parameters

obj object

The object.

Returns

bool

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

FromPoint overloads

FromPoint Method

Converts a Avalonia.Point to device pixels using the specified scaling factor.

public Avalonia.PixelPoint FromPoint(Avalonia.Point point, Avalonia.Vector scale)
Parameters

point Avalonia.Point

The point.

scale Avalonia.Vector

The scaling factor.

Returns

Avalonia.PixelPoint

The device-independent point.

FromPoint Method

Converts a Avalonia.Point to device pixels using the specified scaling factor.

public Avalonia.PixelPoint FromPoint(Avalonia.Point point, double scale)
Parameters

point Avalonia.Point

The point.

scale double

The scaling factor.

Returns

Avalonia.PixelPoint

The device-independent point.

FromPointWithDpi overloads

FromPointWithDpi Method

Converts a Avalonia.Point to device pixels using the specified dots per inch (DPI).

public Avalonia.PixelPoint FromPointWithDpi(Avalonia.Point point, Avalonia.Vector dpi)
Parameters

point Avalonia.Point

The point.

dpi Avalonia.Vector

The dots per inch of the device.

Returns

Avalonia.PixelPoint

The device-independent point.

FromPointWithDpi Method

Converts a Avalonia.Point to device pixels using the specified dots per inch (DPI).

public Avalonia.PixelPoint FromPointWithDpi(Avalonia.Point point, double dpi)
Parameters

point Avalonia.Point

The point.

dpi double

The dots per inch of the device.

Returns

Avalonia.PixelPoint

The device-independent point.

GetHashCode Method

Returns a hash code for a Avalonia.PixelPoint.

public int GetHashCode()

Returns

int

The hash code.

Parse Method

Parses a Avalonia.PixelPoint string.

public Avalonia.PixelPoint Parse(string s)

Parameters

s string

The string.

Returns

Avalonia.PixelPoint

The Avalonia.PixelPoint.

ToPoint overloads

ToPoint Method

Converts the Avalonia.PixelPoint to a device-independent Avalonia.Point using the specified scaling factor.

public Avalonia.Point ToPoint(Avalonia.Vector scale)
Parameters

scale Avalonia.Vector

The scaling factor.

Returns

Avalonia.Point

The device-independent point.

ToPoint Method

Converts the Avalonia.PixelPoint to a device-independent Avalonia.Point using the specified scaling factor.

public Avalonia.Point ToPoint(double scale)
Parameters

scale double

The scaling factor.

Returns

Avalonia.Point

The device-independent point.

ToPointWithDpi overloads

ToPointWithDpi Method

Converts the Avalonia.PixelPoint to a device-independent Avalonia.Point using the specified dots per inch (DPI).

public Avalonia.Point ToPointWithDpi(Avalonia.Vector dpi)
Parameters

dpi Avalonia.Vector

The dots per inch of the device.

Returns

Avalonia.Point

The device-independent point.

ToPointWithDpi Method

Converts the Avalonia.PixelPoint to a device-independent Avalonia.Point using the specified dots per inch (DPI).

public Avalonia.Point ToPointWithDpi(double dpi)
Parameters

dpi double

The dots per inch of the device.

Returns

Avalonia.Point

The device-independent point.

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 Avalonia.PixelPoint with the same Y co-ordinate and the specified X co-ordinate.

public Avalonia.PixelPoint WithX(int x)

Parameters

x int

The X co-ordinate.

Returns

Avalonia.PixelPoint

The new Avalonia.PixelPoint.

WithY Method

Returns a new Avalonia.PixelPoint with the same X co-ordinate and the specified Y co-ordinate.

public Avalonia.PixelPoint WithY(int y)

Parameters

y int

The Y co-ordinate.

Returns

Avalonia.PixelPoint

The new Avalonia.PixelPoint.

Properties

NameDescription
XGets the X co-ordinate.
YGets the Y co-ordinate.

X Property

Gets the X co-ordinate.

public int X { get; set; }

Y Property

Gets the Y co-ordinate.

public int Y { get; set; }

Fields

NameDescription
OriginA point representing 0,0.

Origin Field

A point representing 0,0.

public Avalonia.PixelPoint Origin