[]
Defines a RectL. This structure is slightly different from System.Drawing.Rectangle as
it is internally storing Left, Top, Right, Bottom instead of Left, Top, Width, Height.
public struct RectL : IEquatable<RectL>
Initializes a new instance of the RectL struct.
public RectL(Rectangle rc)
rc
System.Drawing.RectangleInitializes a new instance of the RectL struct.
public RectL(int x, int y, int width, int height)
x
inty
intwidth
intheight
intInitializes a new instance of the RectL struct.
public RectL(int width, int height)
width
intheight
intThe y-coordinate of the bottom edge.
public int Bottom
An empty rectangle.
public static readonly RectL Empty
An infinite rectangle.
public static readonly RectL Infinite
The x-coordinate of the left edge.
public int Left
The x-coordinate of the right edge.
public int Right
The size of the RectL type, in bytes.
public const int SizeInBytes = 16
The y-coordinate of the top edge.
public int Top
Get the bottom left point of the rectangle.
public Point2L BottomLeft { get; }
Get the bottom right point of the rectangle.
public Point2L BottomRight { get; }
Determines if there is some space within the rectangle.
public bool HasSpace { get; }
Gets or sets the height of the rectangle.
public int Height { get; set; }
Determines if all components of RectL are equal to zero.
public bool IsEmpty { get; }
Gets the point with coordinates of the left top corner of the rectangle.
public Point2L Location { get; }
Gets the size of the rectangle.
public Size2L Size { get; }
Get the top left point of the rectangle.
public Point2L TopLeft { get; }
Get the top right point of the rectangle.
public Point2L TopRight { get; }
Gets or sets the width of the rectangle.
public int Width { get; set; }
Gets or sets the X coordinate of the rectangle.
public int X { get; set; }
Gets or sets the Y coordinate of the rectangle.
public int Y { get; set; }
Determines if the specified rectangle is fully contained within this rectangle.
public bool Contains(RectL rect)
rect
RectLDetermines if the specified point is contained within this rectangle.
public bool Contains(int x, int y)
x
inty
intIndicates whether this instance and a specified object are equal.
public bool Equals(RectL other)
other
RectLIndicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
obj
objectCreates a RectL struct from (left, top, right, bottom) coordinates.
public static RectL FromLTRB(int left, int top, int right, int bottom)
left
inttop
intright
intbottom
intReturns a hash code for this instance.
public override int GetHashCode()
Inflates the rectangle by the specified amount.
public static RectL Inflate(RectL rc, int dx, int dy)
rc
RectLdx
intdy
intInflates the rectangle by the specified amount.
public void Inflate(int dx, int dy)
dx
intdy
intReturns a rectangle that represents the intersection of two rectangles.
public static RectL Intersect(RectL a, RectL b)
Quickly updates a rectangle to represent the intersection with another rectangle.
public void IntersectFast(RectL rect)
rect
RectLThe resulting rectangle may be invalid. Use the HasSpace property to check.
Determines if this rectangle intersects with rect.
public bool IntersectsWith(RectL rect)
rect
RectLConverts the rectangle from (X, Y, Width, Height) to (Left, Top, Right, Bottom) coordinates.
public void MakeLTRB()
Converts the rectangle from (Left, Top, Right, Bottom) to (X, Y, Width, Height) coordinates.
public void MakeXYWH()
Offsets the rectangle by the specified amount.
public static RectL Offset(RectL rc, Size2L sz)
Offsets the rectangle by the specified amount.
public static RectL Offset(RectL rc, int dx, int dy)
rc
RectLdx
intdy
intOffsets the rectangle by the specified amount.
public void Offset(int dx, int dy)
dx
intdy
intConverts RectL to System.Drawing.Rectangle.
public Rectangle ToRectangle()
public RectD ToRectD()
public RectF ToRectF()
Returns a string that represents the current object.
public override string ToString()
Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.
public static RectL Union(RectL a, RectL b)
Determines if the specified values are equal.
public static bool operator ==(RectL left, RectL right)
Performs an explicit conversion from RectL to System.Drawing.Rectangle.
public static explicit operator Rectangle(RectL value)
value
RectLPerforms an explicit conversion from System.Drawing.Rectangle to RectL.
public static explicit operator RectL(Rectangle rc)
rc
System.Drawing.RectangleDetermines if the specified values are not equal.
public static bool operator !=(RectL left, RectL right)