Skip to main content

PixelRect Structure

Represents a rectangle in device pixels.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public readonly struct PixelRect : IEquatable<PixelRect>
View Source
InheritanceObjectValueType → PixelRect
ImplementsIEquatable(PixelRect)

Constructors

PixelRect(PixelSize)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(Int32, Int32, Int32, Int32)Initializes a new instance of the PixelRect structure.

Properties

BottomGets the bottom position of the rectangle.
BottomLeftGets the bottom left point of the rectangle.
BottomRightGets the bottom right point of the rectangle.
CenterGets the center point of the rectangle.
HeightGets the height.
PositionGets the position of the rectangle.
RightGets the right position of the rectangle.
SizeGets the size of the rectangle.
TopLeftGets the top left point of the rectangle.
TopRightGets the top right point of the rectangle.
WidthGets the width.
XGets the X position.
YGets the Y position.

Methods

CenterRect(PixelRect)Centers another rectangle in this rectangle.
Contains(PixelPoint)Determines whether a point in the bounds of the rectangle.
Contains(PixelRect)Determines whether the rectangle fully contains another rectangle.
ContainsExclusive(PixelPoint)Determines whether a point is in the bounds of the rectangle, exclusive of the rectangle's bottom/right edge.
Equals(Object)Returns a boolean indicating whether the given object is equal to this rectangle.
(Overrides ValueType.Equals(Object))
Equals(PixelRect)Returns a boolean indicating whether the rect is equal to the other given rect.
FromRect(Rect, Vector)Converts a Rect to device pixels using the specified scaling factor.
FromRect(Rect, Double)Converts a Rect to device pixels using the specified scaling factor.
FromRectWithDpi(Rect, Vector)Converts a Rect to device pixels using the specified dots per inch (DPI).
FromRectWithDpi(Rect, Double)Converts a Rect to device pixels using the specified dots per inch (DPI).
GetHashCode()Returns the hash code for this instance.
(Overrides ValueType.GetHashCode())
GetType()Gets the Type of the current instance.
(Inherited from Object)
Intersect(PixelRect)Gets the intersection of two rectangles.
Intersects(PixelRect)Determines whether a rectangle intersects with this rectangle.
Parse(String)Parses a PixelRect string.
ToRect(Double)Converts the PixelRect to a device-independent Rect using the specified scaling factor.
ToRect(Vector)Converts the PixelRect to a device-independent Rect using the specified scaling factor.
ToRectWithDpi(Double)Converts the PixelRect to a device-independent Rect using the specified dots per inch (DPI).
ToRectWithDpi(Vector)Converts the PixelRect to a device-independent Rect using the specified dots per inch (DPI).
ToString()Returns the string representation of the rectangle.
(Overrides ValueType.ToString())
Translate(PixelVector)Translates the rectangle by an offset.
Union(PixelRect)Gets the union of two rectangles.
WithHeight(Int32)Returns a new PixelRect with the specified height.
WithWidth(Int32)Returns a new PixelRect with the specified width.
WithX(Int32)Returns a new PixelRect with the specified X position.
WithY(Int32)Returns a new PixelRect with the specified Y position.

Operators

Equality(PixelRect, PixelRect)Checks for equality between two PixelRects.
Inequality(PixelRect, PixelRect)Checks for inequality between two PixelRects.

Extension Methods

ToSKRectI()
(Defined by SkiaSharpExtensions)

See Also

Reference

Avalonia Namespace