Summary
Represents a rectangle in device pixels.
Syntax
public readonly struct PixelRect : ValueType, IEquatable<PixelRect>
Constructors
Name | Summary |
---|---|
PixelRect |
Initializes a new instance of the PixelRect structure.
|
PixelRect |
Initializes a new instance of the PixelRect structure.
|
PixelRect |
Initializes a new instance of the PixelRect structure.
|
PixelRect |
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 |
Centers another rectangle in this rectangle.
|
Contains |
bool |
Determines whether a point in in the bounds of the rectangle.
|
Contains |
bool |
Determines whether the rectangle fully contains another rectangle.
|
Equals |
bool |
Returns a boolean indicating whether the given object is equal to this rectangle.
|
Equals |
bool |
Returns a boolean indicating whether the rect is equal to the other given rect.
|
FromRect |
PixelRect |
Converts a
Rect to device pixels using the specified scaling factor.
static
|
FromRect |
PixelRect |
Converts a
Rect to device pixels using the specified scaling factor.
static
|
FromRectWithDpi |
PixelRect |
Converts a
Rect to device pixels using the specified dots per inch (DPI).
static
|
FromRectWithDpi |
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 |
Gets the intersection of two rectangles.
|
Intersects |
bool |
Determines whether a rectangle intersects with this rectangle.
|
Parse |
PixelRect |
Parses a
PixelRect string.
static
|
ToRect |
Rect | |
ToRect |
Rect | |
ToRectWithDpi |
Rect | |
ToRectWithDpi |
Rect | |
ToString |
string |
Returns the string representation of the rectangle.
|
Translate |
PixelRect |
Translates the rectangle by an offset.
|
Union |
PixelRect |
Gets the union of two rectangles.
|
WithHeight |
PixelRect |
Returns a new
PixelRect with the specified height.
|
WithWidth |
PixelRect |
Returns a new
PixelRect with the specified width.
|
WithX |
PixelRect |
Returns a new
PixelRect with the specified X position.
|
WithY |
PixelRect |
Returns a new
PixelRect with the specified Y position.
|
Operators
Name | Value | Summary |
---|---|---|
operator != |
bool | |
operator == |
bool |