[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.RectL

Struct RectL

Namespace
GrapeCity.Documents.DX
Assembly
GcDocs.DX.Windows.dll

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>
Implements
System.IEquatable<T><RectL>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

RectL(Rectangle)

Initializes a new instance of the RectL struct.

public RectL(Rectangle rc)

Parameters

rc System.Drawing.Rectangle

RectL(int, int, int, int)

Initializes a new instance of the RectL struct.

public RectL(int x, int y, int width, int height)

Parameters

x int
y int
width int
height int

RectL(int, int)

Initializes a new instance of the RectL struct.

public RectL(int width, int height)

Parameters

width int
height int

Fields

Bottom

The y-coordinate of the bottom edge.

public int Bottom

Field Value

int

Empty

An empty rectangle.

public static readonly RectL Empty

Field Value

RectL

Infinite

An infinite rectangle.

public static readonly RectL Infinite

Field Value

RectL

Left

The x-coordinate of the left edge.

public int Left

Field Value

int

Right

The x-coordinate of the right edge.

public int Right

Field Value

int

SizeInBytes

The size of the RectL type, in bytes.

public const int SizeInBytes = 16

Field Value

int

Top

The y-coordinate of the top edge.

public int Top

Field Value

int

Properties

BottomLeft

Get the bottom left point of the rectangle.

public Point2L BottomLeft { get; }

Property Value

Point2L

BottomRight

Get the bottom right point of the rectangle.

public Point2L BottomRight { get; }

Property Value

Point2L

HasSpace

Determines if there is some space within the rectangle.

public bool HasSpace { get; }

Property Value

bool

Height

Gets or sets the height of the rectangle.

public int Height { get; set; }

Property Value

int

IsEmpty

Determines if all components of RectL are equal to zero.

public bool IsEmpty { get; }

Property Value

bool

Location

Gets the point with coordinates of the left top corner of the rectangle.

public Point2L Location { get; }

Property Value

Point2L

Size

Gets the size of the rectangle.

public Size2L Size { get; }

Property Value

Size2L

TopLeft

Get the top left point of the rectangle.

public Point2L TopLeft { get; }

Property Value

Point2L

TopRight

Get the top right point of the rectangle.

public Point2L TopRight { get; }

Property Value

Point2L

Width

Gets or sets the width of the rectangle.

public int Width { get; set; }

Property Value

int

X

Gets or sets the X coordinate of the rectangle.

public int X { get; set; }

Property Value

int

Y

Gets or sets the Y coordinate of the rectangle.

public int Y { get; set; }

Property Value

int

Methods

Contains(RectL)

Determines if the specified rectangle is fully contained within this rectangle.

public bool Contains(RectL rect)

Parameters

rect RectL

Returns

bool

Contains(int, int)

Determines if the specified point is contained within this rectangle.

public bool Contains(int x, int y)

Parameters

x int
y int

Returns

bool

Equals(RectL)

Indicates whether this instance and a specified object are equal.

public bool Equals(RectL other)

Parameters

other RectL

Returns

bool

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

FromLTRB(int, int, int, int)

Creates a RectL struct from (left, top, right, bottom) coordinates.

public static RectL FromLTRB(int left, int top, int right, int bottom)

Parameters

left int
top int
right int
bottom int

Returns

RectL

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

Inflate(RectL, int, int)

Inflates the rectangle by the specified amount.

public static RectL Inflate(RectL rc, int dx, int dy)

Parameters

rc RectL
dx int
dy int

Returns

RectL

Inflate(int, int)

Inflates the rectangle by the specified amount.

public void Inflate(int dx, int dy)

Parameters

dx int
dy int

Intersect(RectL, RectL)

Returns a rectangle that represents the intersection of two rectangles.

public static RectL Intersect(RectL a, RectL b)

Parameters

a RectL
b RectL

Returns

RectL

IntersectFast(RectL)

Quickly updates a rectangle to represent the intersection with another rectangle.

public void IntersectFast(RectL rect)

Parameters

rect RectL

Remarks

The resulting rectangle may be invalid. Use the HasSpace property to check.

IntersectsWith(RectL)

Determines if this rectangle intersects with rect.

public bool IntersectsWith(RectL rect)

Parameters

rect RectL

Returns

bool

MakeLTRB()

Converts the rectangle from (X, Y, Width, Height) to (Left, Top, Right, Bottom) coordinates.

public void MakeLTRB()

MakeXYWH()

Converts the rectangle from (Left, Top, Right, Bottom) to (X, Y, Width, Height) coordinates.

public void MakeXYWH()

Offset(RectL, Size2L)

Offsets the rectangle by the specified amount.

public static RectL Offset(RectL rc, Size2L sz)

Parameters

rc RectL
sz Size2L

Returns

RectL

Offset(RectL, int, int)

Offsets the rectangle by the specified amount.

public static RectL Offset(RectL rc, int dx, int dy)

Parameters

rc RectL
dx int
dy int

Returns

RectL

Offset(int, int)

Offsets the rectangle by the specified amount.

public void Offset(int dx, int dy)

Parameters

dx int
dy int

ToRectangle()

Converts RectL to System.Drawing.Rectangle.

public Rectangle ToRectangle()

Returns

System.Drawing.Rectangle

ToRectD()

Converts RectL to RectD.

public RectD ToRectD()

Returns

RectD

ToRectF()

Converts RectL to RectF.

public RectF ToRectF()

Returns

RectF

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

Union(RectL, RectL)

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)

Parameters

a RectL
b RectL

Returns

RectL

Operators

operator ==(RectL, RectL)

Determines if the specified values are equal.

public static bool operator ==(RectL left, RectL right)

Parameters

left RectL
right RectL

Returns

bool

explicit operator Rectangle(RectL)

Performs an explicit conversion from RectL to System.Drawing.Rectangle.

public static explicit operator Rectangle(RectL value)

Parameters

value RectL

Returns

System.Drawing.Rectangle

explicit operator RectL(Rectangle)

Performs an explicit conversion from System.Drawing.Rectangle to RectL.

public static explicit operator RectL(Rectangle rc)

Parameters

rc System.Drawing.Rectangle

Returns

RectL

operator !=(RectL, RectL)

Determines if the specified values are not equal.

public static bool operator !=(RectL left, RectL right)

Parameters

left RectL
right RectL

Returns

bool