[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.RectD

Struct RectD

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

Structure specifing a rectangle with double Left, Top, Right, Bottom coordinates.

public struct RectD : IEquatable<RectD>
Implements
System.IEquatable<T><RectD>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

RectD(RectF)

Initializes a new instance of the RectD struct.

public RectD(RectF rc)

Parameters

rc RectF

RectD(double, double, double, double)

Initializes a new instance of the RectD struct.

public RectD(double x, double y, double width, double height)

Parameters

x double
y double
width double
height double

RectD(double, double)

Initializes a new instance of the RectD struct.

public RectD(double width, double height)

Parameters

width double
height double

RectD(RectangleF)

Initializes a new instance of the RectD struct.

public RectD(RectangleF rc)

Parameters

rc System.Drawing.RectangleF

Fields

Bottom

The y-coordinate of the bottom edge.

public double Bottom

Field Value

double

Empty

An empty rectangle.

public static readonly RectD Empty

Field Value

RectD

Infinite

A rectangle that has its upper-left corner set to (negative infinity, negative infinity) and its lower-right corner set to (infinity, infinity).

public static readonly RectD Infinite

Field Value

RectD

Left

The x-coordinate of the left edge.

public double Left

Field Value

double

Right

The x-coordinate of the right edge.

public double Right

Field Value

double

SizeInBytes

The size of the RectD type, in bytes.

public const int SizeInBytes = 32

Field Value

int

Top

The y-coordinate of the top edge.

public double Top

Field Value

double

Properties

Center

Gets the point with coordinates of the rectangle center.

public Point2D Center { get; }

Property Value

Point2D

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 double Height { get; set; }

Property Value

double

IsEmpty

Determines if all components of RectD 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 Point2D Location { get; }

Property Value

Point2D

Size

Gets the size of the rectangle.

public Size2D Size { get; }

Property Value

Size2D

Width

Gets or sets the width of the rectangle.

public double Width { get; set; }

Property Value

double

X

Gets or sets the X coordinate of the rectangle.

public double X { get; set; }

Property Value

double

Y

Gets or sets the Y coordinate of the rectangle.

public double Y { get; set; }

Property Value

double

Methods

Circumscribe()

Returns a RectL with circumscribed coordinates.

public RectL Circumscribe()

Returns

RectL

Contains(RectD)

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

public bool Contains(RectD rect)

Parameters

rect RectD

Returns

bool

Contains(double, double)

Determines if the specified point is contained within this rectangle.

public bool Contains(double x, double y)

Parameters

x double
y double

Returns

bool

Equals(RectD)

Indicates whether this instance and a specified object are equal.

public bool Equals(RectD other)

Parameters

other RectD

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

FromDips(RectD, float, float)

Converts a rectangle from DIPs to pixels.

public static RectD FromDips(RectD rc, float dpiX, float dpiY)

Parameters

rc RectD
dpiX float
dpiY float

Returns

RectD

FromDips(float, float)

Converts a rectangle from DIPs to pixels.

public void FromDips(float dpiX, float dpiY)

Parameters

dpiX float
dpiY float

FromLTRB(double, double, double, double)

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

public static RectD FromLTRB(double left, double top, double right, double bottom)

Parameters

left double
top double
right double
bottom double

Returns

RectD

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

Inflate(RectD, double, double)

Inflates the rectangle by the specified amount.

public static RectD Inflate(RectD rc, double dx, double dy)

Parameters

rc RectD
dx double
dy double

Returns

RectD

Inflate(double, double)

Inflates the rectangle by the specified amount.

public void Inflate(double dx, double dy)

Parameters

dx double
dy double

Intersect(RectD, RectD)

Returns a rectangle that represents the intersection of two rectangles.

public static RectD Intersect(RectD a, RectD b)

Parameters

a RectD
b RectD

Returns

RectD

IntersectFast(RectD)

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

public void IntersectFast(RectD rect)

Parameters

rect RectD

Remarks

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

IntersectsWith(RectD)

Determines if this rectangle intersects with rect.

public bool IntersectsWith(RectD rect)

Parameters

rect RectD

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(RectD, Size2D)

Offsets the rectangle by the specified amount.

public static RectD Offset(RectD rc, Size2D sz)

Parameters

rc RectD
sz Size2D

Returns

RectD

Offset(RectD, double, double)

Offsets the rectangle by the specified amount.

public static RectD Offset(RectD rc, double dx, double dy)

Parameters

rc RectD
dx double
dy double

Returns

RectD

Offset(double, double)

Offsets the rectangle by the specified amount.

public void Offset(double dx, double dy)

Parameters

dx double
dy double

PointFromRect(Point2D)

Recalculates the point coordinates from relative units (0..1, 0..1) to absolute (Left..Right, Top..Bottom).

public Point2D PointFromRect(Point2D pt)

Parameters

pt Point2D

The source point in relative coordinates (0..1, 0..1).

Returns

Point2D

The resulting point in absolute coordinates (Left..Right, Top..Bottom).

Round()

Returns a RectL with rounded coordinates.

public RectL Round()

Returns

RectL

Scale(RectD, double, double)

Scales all coordinates of a rectangle by the specified scaleX and scaleY.

public static RectD Scale(RectD rc, double scaleX, double scaleY)

Parameters

rc RectD
scaleX double
scaleY double

Returns

RectD

Scale(RectD, double)

Scales all coordinates of a rectangle by the specified scaleFactor.

public static RectD Scale(RectD rc, double scaleFactor)

Parameters

rc RectD
scaleFactor double

Returns

RectD

Scale(double, double)

Scales all coordinates of a rectangle by the specified scaleX and scaleY.

public void Scale(double scaleX, double scaleY)

Parameters

scaleX double
scaleY double

Scale(double)

Scales all coordinates of a rectangle by the specified scaleFactor.

public void Scale(double scaleFactor)

Parameters

scaleFactor double

ToDips(RectD, float, float)

Converts a rectangle from pixels to DIPs.

public static RectD ToDips(RectD rc, float dpiX, float dpiY)

Parameters

rc RectD
dpiX float
dpiY float

Returns

RectD

ToDips(float, float)

Converts a rectangle from pixels to DIPs.

public void ToDips(float dpiX, float dpiY)

Parameters

dpiX float
dpiY float

ToRectangleF()

Converts RectD to System.Drawing.RectangleF.

public RectangleF ToRectangleF()

Returns

System.Drawing.RectangleF

ToRectF()

Converts RectD to RectF.

public RectF ToRectF()

Returns

RectF

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

Truncate()

Returns a RectL with truncated coordinates.

public RectL Truncate()

Returns

RectL

Union(RectD, RectD)

Creates the smallest possible third rectangle that can contain both of two rectangles that form a union.

public static RectD Union(RectD a, RectD b)

Parameters

a RectD
b RectD

Returns

RectD

Operators

operator ==(RectD, RectD)

Determines if the specified values are equal.

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

Parameters

left RectD
right RectD

Returns

bool

operator !=(RectD, RectD)

Determines if the specified values are not equal.

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

Parameters

left RectD
right RectD

Returns

bool