Table of Contents

Struct Rect

Namespace
Root.ReportNet.Pdf.Tools
Assembly
ReportNet.dll

Represents a rectangle defined by its left, bottom, right, and top coordinates.

public readonly struct Rect
Inherited Members

Examples

Rect r = new Rect(20, 30, 150, 100);

Constructors

Rect(double, double, double, double)

Initializes a new instance of the Rect struct.

public Rect(double left, double bottom, double right, double top)

Parameters

left double

The left coordinate of the rectangle in points.

bottom double

The bottom coordinate of the rectangle in points.

right double

The right coordinate of the rectangle in points.

top double

The top coordinate of the rectangle in points.

Properties

Bottom

Gets the bottom coordinate of the rectangle in points.

public double Bottom { get; }

Property Value

double

The bottom coordinate in points.

BottomMM

Gets the bottom coordinate of the rectangle in millimeters.

public double BottomMM { get; }

Property Value

double

The bottom coordinate in millimeters.

Height

Gets the height of the rectangle in points.

public double Height { get; }

Property Value

double

The height in points.

HeightMM

Gets the height of the rectangle in millimeters.

public double HeightMM { get; }

Property Value

double

The height in millimeters.

Left

Gets the left coordinate of the rectangle in points.

public double Left { get; }

Property Value

double

The left coordinate in points.

LeftMM

Gets the left coordinate of the rectangle in millimeters.

public double LeftMM { get; }

Property Value

double

The left coordinate in millimeters.

Right

Gets the right coordinate of the rectangle in points.

public double Right { get; }

Property Value

double

The right coordinate in points.

RightMM

Gets the right coordinate of the rectangle in millimeters.

public double RightMM { get; }

Property Value

double

The right coordinate in millimeters.

Top

Gets the top coordinate of the rectangle in points.

public double Top { get; }

Property Value

double

The top coordinate in points.

TopMM

Gets the top coordinate of the rectangle in millimeters.

public double TopMM { get; }

Property Value

double

The top coordinate in millimeters.

Width

Gets the width of the rectangle in points.

public double Width { get; }

Property Value

double

The width in points.

WidthMM

Gets the width of the rectangle in millimeters.

public double WidthMM { get; }

Property Value

double

The width in millimeters.

Methods

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Move(double, double)

Moves the rectangle by the specified amount in the x and y directions.

public Rect Move(double x, double y)

Parameters

x double

The amount to move the rectangle in the x direction.

y double

The amount to move the rectangle in the y direction.

Returns

Rect

A new Rect instance representing the moved rectangle.

ToString()

Returns a string representation of this rectangle.

public override string ToString()

Returns

string

A string that represents this rectangle.

Operators

operator ==(Rect, Rect)

Determines whether two rectangles are equal.

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

Parameters

left Rect

The first rectangle to compare.

right Rect

The second rectangle to compare.

Returns

bool

true if the two instances are equal; otherwise false.

operator !=(Rect, Rect)

Determines whether two rectangles are not equal.

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

Parameters

left Rect

The first rectangle to compare.

right Rect

The second rectangle to compare.

Returns

bool

true if the two instances are not equal; otherwise true.