PixelPoint Struct
Definition
Represents a point in device pixels.
public struct PixelPoint
Constructors
| Name | Description |
|---|---|
| PixelPoint | Initializes 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
| Name | Description |
|---|---|
| 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). |
| GetHashCode | Returns a hash code for a Avalonia.PixelPoint. |
| Parse | Parses 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). |
| ToString | Returns the string representation of the point. |
| WithX | Returns a new Avalonia.PixelPoint with the same Y co-ordinate and the specified X co-ordinate. |
| WithY | Returns 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
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
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
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
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
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
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
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
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
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
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
The new Avalonia.PixelPoint.
Properties
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
| Name | Description |
|---|---|
| Origin | A point representing 0,0. |
Origin Field
A point representing 0,0.
public Avalonia.PixelPoint Origin