Struct RectI
Stores the location and size of a rectangular region.
[Serializable]
public struct RectI : IEquatable<RectI>
- Implements
Constructors
- RectI(PointI, SizeI)
Initializes a new instance of the Rectangle class with the specified location and size.
- RectI(int, int, int, int)
Initializes a new instance of the RectI class with the specified location and size.
Fields
Properties
- Bottom
Gets the y-coordinate of the lower-right corner of the rectangular region defined by this RectI.
- BottomLeft
Gets the point which is at (X, Y + Height).
- BottomRight
Gets the point which is at (X + Width, Y + Height).
- Left
Gets the x-coordinate of the upper-left corner of the rectangular region defined by this RectI .
- Location
Gets or sets the coordinates of the upper-left corner of the rectangular region represented by this RectI.
- PixelCount
Gets number of pixels (Width * Height).
- Right
Gets the x-coordinate of the lower-right corner of the rectangular region defined by this RectI.
- SizeIsEmpty
Tests whether this RectI has a Width or a Height less than or equal to 0.
- TopLeft
This is a read-only alias for the point which is at (X, Y).
- TopRight
Gets the point which is at (X + Width, Y).
- X
Gets or sets the x-coordinate of the upper-left corner of the rectangular region defined by this RectI.
- Y
Gets or sets the y-coordinate of the upper-left corner of the rectangular region defined by this RectI.
Methods
- Ceiling(RectD)
Converts a RectangleF to a Rectangle by performing a ceiling operation on all the coordinates.
- Contains(PointI)
Determines if the specified point is contained within the rectangular region defined by this RectI .
- Contains(RectI)
Determines if the rectangular region represented by
rect
is entirely contained within the rectangular region represented by this RectI .
- Contains(int, int)
Determines if the specified point is contained within the rectangular region defined by this RectI .
- ConvertToString(string, IFormatProvider)
Creates a string representation of this object based on the format string and IFormatProvider passed in. If the provider is null, the CurrentCulture is used. See the documentation for IFormattable for more information.
- Create(int, int)
Creates new rectangle with the specified width and height.
- Equals(RectI)
Indicates whether the current object is equal to another object of the same type.
- Equals(object?)
Tests whether
obj
is a RectI with the same location and size of this Rectangle.
- FromLTRB(PointI, PointI)
Creates a new RectI specified by two points.
- FromLTRB(int, int, int, int)
Creates a new RectI using (
left
,top
) and (right
,bottom
) points.
- GetHashCode()
Serves as the default hash function.
- Inflate(RectI, int, int)
Creates a RectI that is inflated by the specified amount.
- Inflate(SizeI)
Inflates this RectI by the specified amount.
- Inflate(int, int)
Inflates this RectI by the specified amount.
- Intersect(RectI)
Creates a Rectangle that represents the intersection between this Rectangle and rect.
- Intersect(RectI, RectI)
Creates a rectangle that represents the intersection between a and b. If there is no intersection, an empty rectangle is returned.
- IntersectsWith(RectI)
Determines if this rectangle intersects with rect.
- Offset(PointI)
Adjusts the location of this rectangle by the specified amount.
- Offset(int, int)
Adjusts the location of this rectangle by the specified amount.
- Parse(string)
Parse - returns an instance converted from the provided string using the culture "en-US"
string with Int32Rect data
- PixelToDip(double?)
Converts this rectangle to rectangle with device-indepdenent units using the specified scale factor.
- Round(RectD)
Converts a RectangleF to a Rectangle by performing a round operation on all the coordinates.
- ToString()
Converts the attributes of this RectI to a human readable string.
- Truncate(RectD)
Converts a RectangleF to a Rectangle by performing a truncate operation on all the coordinates.
- Union(RectI, RectI)
Creates a rectangle that represents the union between a and b.
- WithHeight(int)
Returns new rectangle with location and width of this rectangle and the specified height.
- WithWidth(int)
Returns new rectangle with location and height of this rectangle and the specified width.
- WithX(int)
Returns new rectangle with size and y-coordinate of this rectangle and the specified x-coordinate.
- WithY(int)
Returns new rectangle with size and x-coordinate of this rectangle and the specified y-coordinate.
Operators
- operator ==(RectI, RectI)
Tests whether two RectI objects have equal location and size.
- implicit operator Rectangle(RectI)
Creates a Rectangle with the coordinates of the specified RectI
- implicit operator RectI(Rectangle)
Creates a RectI with the coordinates of the specified Rectangle
- implicit operator RectI((PointI, SizeI))
Implicit operator convertion from tuple (PointI, SizeI) to RectI.
- implicit operator RectI((int, int, int, int))
Implicit operator convertion from tuple with four int values to RectI.
- operator !=(RectI, RectI)
Tests whether two RectI objects differ in location or size.