PixelRect Struct

Summary

Represents a rectangle in device pixels.
Namespace
Avalonia
Interfaces
Base Types
  • object
  • ValueType
graph BT Type-->Base0["ValueType"] Base0-->Base1["object"] Type-.->Interface0["IEquatable<PixelRect>"] Type["PixelRect"] class Type type-node

Syntax

public readonly struct PixelRect : ValueType, IEquatable<PixelRect>

Constructors

Name Summary
PixelRect(int, int, int, int) Initializes a new instance of the PixelRect structure.
PixelRect(PixelPoint, PixelPoint) Initializes a new instance of the PixelRect structure.
PixelRect(PixelPoint, PixelSize) Initializes a new instance of the PixelRect structure.
PixelRect(PixelSize) Initializes a new instance of the PixelRect structure.

Fields

Name Constant Value Summary
Empty
An empty rectangle.
static

Properties

Name Value Summary
Bottom int
Gets the bottom position of the rectangle.
BottomLeft PixelPoint
Gets the bottom left point of the rectangle.
BottomRight PixelPoint
Gets the bottom right point of the rectangle.
Center PixelPoint
Gets the center point of the rectangle.
Height int
Gets the height.
IsEmpty bool
Gets a value that indicates whether the rectangle is empty.
Position PixelPoint
Gets the position of the rectangle.
Right int
Gets the right position of the rectangle.
Size PixelSize
Gets the size of the rectangle.
TopLeft PixelPoint
Gets the top left point of the rectangle.
TopRight PixelPoint
Gets the top right point of the rectangle.
Width int
Gets the width.
X int
Gets the X position.
Y int
Gets the Y position.

Methods

Name Value Summary
CenterRect(PixelRect) PixelRect
Centers another rectangle in this rectangle.
Contains(PixelPoint) bool
Determines whether a point in in the bounds of the rectangle.
Contains(PixelRect) bool
Determines whether the rectangle fully contains another rectangle.
Equals(object) bool
Returns a boolean indicating whether the given object is equal to this rectangle.
Equals(PixelRect) bool
Returns a boolean indicating whether the rect is equal to the other given rect.
FromRect(Rect, double) PixelRect
Converts a Rect to device pixels using the specified scaling factor.
static
FromRect(Rect, Vector) PixelRect
Converts a Rect to device pixels using the specified scaling factor.
static
FromRectWithDpi(Rect, double) PixelRect
Converts a Rect to device pixels using the specified dots per inch (DPI).
static
FromRectWithDpi(Rect, Vector) PixelRect
Converts a Rect to device pixels using the specified dots per inch (DPI).
static
GetHashCode() int
Returns the hash code for this instance.
Intersect(PixelRect) PixelRect
Gets the intersection of two rectangles.
Intersects(PixelRect) bool
Determines whether a rectangle intersects with this rectangle.
Parse(string) PixelRect
Parses a PixelRect string.
static
ToRect(double) Rect
Converts the PixelRect to a device-independent Rect using the specified scaling factor.
ToRect(Vector) Rect
Converts the PixelRect to a device-independent Rect using the specified scaling factor.
ToRectWithDpi(double) Rect
Converts the PixelRect to a device-independent Rect using the specified dots per inch (DPI).
ToRectWithDpi(Vector) Rect
Converts the PixelRect to a device-independent Rect using the specified dots per inch (DPI).
ToString() string
Returns the string representation of the rectangle.
Translate(PixelVector) PixelRect
Translates the rectangle by an offset.
Union(PixelRect) PixelRect
Gets the union of two rectangles.
WithHeight(int) PixelRect
Returns a new PixelRect with the specified height.
WithWidth(int) PixelRect
Returns a new PixelRect with the specified width.
WithX(int) PixelRect
Returns a new PixelRect with the specified X position.
WithY(int) PixelRect
Returns a new PixelRect with the specified Y position.

Operators

Name Value Summary
operator !=(PixelRect, PixelRect) bool
operator ==(PixelRect, PixelRect) bool