PDFsharp-net6

XRect

Namespace: PdfSharp.Drawing

Stores a set of four floating-point numbers that represent the location and size of a rectangle.

public struct XRect

Inheritance ObjectValueTypeXRect
Implements IFormattable

Properties

Empty

Gets the empty rectangle.

public static XRect Empty { get; }

Property Value

XRect

IsEmpty

Gets a value indicating whether this instance is empty.

public bool IsEmpty { get; }

Property Value

Boolean

Location

Gets or sets the location of the rectangle.

public XPoint Location { get; set; }

Property Value

XPoint

Size

Gets or sets the size of the rectangle.

public XSize Size { get; set; }

Property Value

XSize

X

Gets or sets the X value of the rectangle.

public double X { get; set; }

Property Value

Double

Y

Gets or sets the Y value of the rectangle.

public double Y { get; set; }

Property Value

Double

Width

Gets or sets the width of the rectangle.

public double Width { get; set; }

Property Value

Double

Height

Gets or sets the height of the rectangle.

public double Height { get; set; }

Property Value

Double

Left

Gets the x-axis value of the left side of the rectangle.

public double Left { get; }

Property Value

Double

Top

Gets the y-axis value of the top side of the rectangle.

public double Top { get; }

Property Value

Double

Gets the x-axis value of the right side of the rectangle.

public double Right { get; }

Property Value

Double

Bottom

Gets the y-axis value of the bottom side of the rectangle.

public double Bottom { get; }

Property Value

Double

TopLeft

Gets the position of the top-left corner of the rectangle.

public XPoint TopLeft { get; }

Property Value

XPoint

TopRight

Gets the position of the top-right corner of the rectangle.

public XPoint TopRight { get; }

Property Value

XPoint

BottomLeft

Gets the position of the bottom-left corner of the rectangle.

public XPoint BottomLeft { get; }

Property Value

XPoint

BottomRight

Gets the position of the bottom-right corner of the rectangle.

public XPoint BottomRight { get; }

Property Value

XPoint

Center

Gets the center of the rectangle.

public XPoint Center { get; }

Property Value

XPoint

Constructors

XRect(Double, Double, Double, Double)

Initializes a new instance of the XRect class.

XRect(double x, double y, double width, double height)

Parameters

x Double

y Double

width Double

height Double

XRect(XPoint, XPoint)

Initializes a new instance of the XRect class.

XRect(XPoint point1, XPoint point2)

Parameters

point1 XPoint

point2 XPoint

XRect(XPoint, XVector)

Initializes a new instance of the XRect class.

XRect(XPoint point, XVector vector)

Parameters

point XPoint

vector XVector

XRect(XPoint, XSize)

Initializes a new instance of the XRect class.

XRect(XPoint location, XSize size)

Parameters

location XPoint

size XSize

XRect(XSize)

Initializes a new instance of the XRect class.

XRect(XSize size)

Parameters

size XSize

Methods

FromLTRB(Double, Double, Double, Double)

Creates a rectangle from four straight lines.

XRect FromLTRB(double left, double top, double right, double bottom)

Parameters

left Double

top Double

right Double

bottom Double

Returns

XRect

Equals(XRect, XRect)

Determines whether the two rectangles are equal.

bool Equals(XRect rect1, XRect rect2)

Parameters

rect1 XRect

rect2 XRect

Returns

Boolean

Equals(Object)

Determines whether this instance and the specified object are equal.

bool Equals(object o)

Parameters

o Object

Returns

Boolean

Equals(XRect)

Determines whether this instance and the specified rect are equal.

bool Equals(XRect value)

Parameters

value XRect

Returns

Boolean

GetHashCode()

Returns the hash code for this instance.

int GetHashCode()

Returns

Int32

Parse(String)

Parses the rectangle from a string.

XRect Parse(string source)

Parameters

source String

Returns

XRect

ToString()

Converts this XRect to a human readable string.

string ToString()

Returns

String

ToString(IFormatProvider)

Converts this XRect to a human readable string.

string ToString(IFormatProvider provider)

Parameters

provider IFormatProvider

Returns

String

ConvertToString(String, IFormatProvider)

string ConvertToString(string format, IFormatProvider provider)

Parameters

format String

provider IFormatProvider

Returns

String

Contains(XPoint)

Indicates whether the rectangle contains the specified point.

bool Contains(XPoint point)

Parameters

point XPoint

Returns

Boolean

Contains(Double, Double)

Indicates whether the rectangle contains the specified point.

bool Contains(double x, double y)

Parameters

x Double

y Double

Returns

Boolean

Contains(XRect)

Indicates whether the rectangle contains the specified rectangle.

bool Contains(XRect rect)

Parameters

rect XRect

Returns

Boolean

IntersectsWith(XRect)

Indicates whether the specified rectangle intersects with the current rectangle.

bool IntersectsWith(XRect rect)

Parameters

rect XRect

Returns

Boolean

Intersect(XRect)

Sets current rectangle to the intersection of the current rectangle and the specified rectangle.

void Intersect(XRect rect)

Parameters

rect XRect

Intersect(XRect, XRect)

Returns the intersection of two rectangles.

XRect Intersect(XRect rect1, XRect rect2)

Parameters

rect1 XRect

rect2 XRect

Returns

XRect

Union(XRect)

Sets current rectangle to the union of the current rectangle and the specified rectangle.

void Union(XRect rect)

Parameters

rect XRect

Union(XRect, XRect)

Returns the union of two rectangles.

XRect Union(XRect rect1, XRect rect2)

Parameters

rect1 XRect

rect2 XRect

Returns

XRect

Union(XPoint)

Sets current rectangle to the union of the current rectangle and the specified point.

void Union(XPoint point)

Parameters

point XPoint

Union(XRect, XPoint)

Returns the union of a rectangle and a point.

XRect Union(XRect rect, XPoint point)

Parameters

rect XRect

point XPoint

Returns

XRect

Offset(XVector)

Moves a rectangle by the specified amount.

void Offset(XVector offsetVector)

Parameters

offsetVector XVector

Offset(Double, Double)

Moves a rectangle by the specified amount.

void Offset(double offsetX, double offsetY)

Parameters

offsetX Double

offsetY Double

Offset(XRect, XVector)

Returns a rectangle that is offset from the specified rectangle by using the specified vector.

XRect Offset(XRect rect, XVector offsetVector)

Parameters

rect XRect

offsetVector XVector

Returns

XRect

Offset(XRect, Double, Double)

Returns a rectangle that is offset from the specified rectangle by using specified horizontal and vertical amounts.

XRect Offset(XRect rect, double offsetX, double offsetY)

Parameters

rect XRect

offsetX Double

offsetY Double

Returns

XRect

Inflate(XSize)

Expands the rectangle by using the specified Size, in all directions.

void Inflate(XSize size)

Parameters

size XSize

Inflate(Double, Double)

Expands or shrinks the rectangle by using the specified width and height amounts, in all directions.

void Inflate(double width, double height)

Parameters

width Double

height Double

Inflate(XRect, XSize)

Returns the rectangle that results from expanding the specified rectangle by the specified Size, in all directions.

XRect Inflate(XRect rect, XSize size)

Parameters

rect XRect

size XSize

Returns

XRect

Inflate(XRect, Double, Double)

Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified width and height amounts, in all directions.

XRect Inflate(XRect rect, double width, double height)

Parameters

rect XRect

width Double

height Double

Returns

XRect

Transform(XRect, XMatrix)

Returns the rectangle that results from applying the specified matrix to the specified rectangle.

XRect Transform(XRect rect, XMatrix matrix)

Parameters

rect XRect

matrix XMatrix

Returns

XRect

Transform(XMatrix)

Transforms the rectangle by applying the specified matrix.

void Transform(XMatrix matrix)

Parameters

matrix XMatrix

Scale(Double, Double)

Multiplies the size of the current rectangle by the specified x and y values.

void Scale(double scaleX, double scaleY)

Parameters

scaleX Double

scaleY Double