Table of Contents

Struct RRect

Namespace
TheArtOfDev.HtmlRenderer.Adapters.Entities
Assembly
StockSharp.Xaml.dll

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

public struct RRect
Inherited Members
Extension Methods

Constructors

RRect(double, double, double, double)

Initializes a new instance of the RRect class with the specified location and size.

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

Parameters

x double

The x-coordinate of the upper-left corner of the rectangle.

y double

The y-coordinate of the upper-left corner of the rectangle.

width double

The width of the rectangle.

height double

The height of the rectangle.

RRect(RPoint, RSize)

Initializes a new instance of the RRect class with the specified location and size.

public RRect(RPoint location, RSize size)

Parameters

location RPoint

A RPoint that represents the upper-left corner of the rectangular region.

size RSize

A RSize that represents the width and height of the rectangular region.

Fields

Empty

Represents an instance of the RRect class with its members uninitialized.

public static readonly RRect Empty

Field Value

RRect

Properties

Bottom

Gets the y-coordinate that is the sum of Y and Height of this RRect structure.

public double Bottom { get; }

Property Value

double

The y-coordinate that is the sum of Y and Height of this RRect structure.

Height

Gets or sets the height of this RRect structure.

public double Height { get; set; }

Property Value

double

The height of this RRect structure.

IsEmpty

Tests whether the Width or Height property of this RRect has a value of zero.

public bool IsEmpty { get; }

Property Value

bool

This property returns true if the Width or Height property of this RRect has a value of zero; otherwise, false.

Left

Gets the x-coordinate of the left edge of this RRect structure.

public double Left { get; }

Property Value

double

The x-coordinate of the left edge of this RRect structure.

Location

Gets or sets the coordinates of the upper-left corner of this RRect structure.

public RPoint Location { get; set; }

Property Value

RPoint

A RPoint that represents the upper-left corner of this RRect structure.

Right

Gets the x-coordinate that is the sum of X and Width of this RRect structure.

public double Right { get; }

Property Value

double

The x-coordinate that is the sum of X and Width of this RRect structure.

Size

Gets or sets the size of this RRect.

public RSize Size { get; set; }

Property Value

RSize

A RSize that represents the width and height of this RRect structure.

Top

Gets the y-coordinate of the top edge of this RRect structure.

public double Top { get; }

Property Value

double

The y-coordinate of the top edge of this RRect structure.

Width

Gets or sets the width of this RRect structure.

public double Width { get; set; }

Property Value

double

The width of this RRect structure.

X

Gets or sets the x-coordinate of the upper-left corner of this RRect structure.

public double X { get; set; }

Property Value

double

The x-coordinate of the upper-left corner of this RRect structure.

Y

Gets or sets the y-coordinate of the upper-left corner of this RRect structure.

public double Y { get; set; }

Property Value

double

The y-coordinate of the upper-left corner of this RRect structure.

Methods

Contains(double, double)

Determines if the specified point is contained within this RRect structure.

public bool Contains(double x, double y)

Parameters

x double

The x-coordinate of the point to test.

y double

The y-coordinate of the point to test.

Returns

bool

This method returns true if the point defined by x and y is contained within this RRect structure; otherwise false.

Contains(RPoint)

Determines if the specified point is contained within this RRect structure.

public bool Contains(RPoint pt)

Parameters

pt RPoint

The RPoint to test.

Returns

bool

This method returns true if the point represented by the pt parameter is contained within this RRect structure; otherwise false.

Contains(RRect)

Determines if the rectangular region represented by rect is entirely contained within this RRect structure.

public bool Contains(RRect rect)

Parameters

rect RRect

The RRect to test.

Returns

bool

This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this RRect ; otherwise false.

Equals(object)

Tests whether obj is a RRect with the same location and size of this RRect.

public override bool Equals(object obj)

Parameters

obj object

The object to test.

Returns

bool

This method returns true if obj is a RRect and its X, Y, Width, and Height properties are equal to the corresponding properties of this RRect; otherwise, false.

FromLTRB(double, double, double, double)

Creates a RRect structure with upper-left corner and lower-right corner at the specified locations.

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

Parameters

left double

The x-coordinate of the upper-left corner of the rectangular region.

top double

The y-coordinate of the upper-left corner of the rectangular region.

right double

The x-coordinate of the lower-right corner of the rectangular region.

bottom double

The y-coordinate of the lower-right corner of the rectangular region.

Returns

RRect

The new RRect that this method creates.

GetHashCode()

Gets the hash code for this RRect structure. For information about the use of hash codes, see Object.GetHashCode.

public override int GetHashCode()

Returns

int

The hash code for this RRect

Inflate(double, double)

Inflates this RRect structure by the specified amount.

public void Inflate(double x, double y)

Parameters

x double

The amount to inflate this RRect structure horizontally.

y double

The amount to inflate this RRect structure vertically.

Inflate(RRect, double, double)

Creates and returns an inflated copy of the specified RRect structure. The copy is inflated by the specified amount. The original rectangle remains unmodified.

public static RRect Inflate(RRect rect, double x, double y)

Parameters

rect RRect

The RRect to be copied. This rectangle is not modified.

x double

The amount to inflate the copy of the rectangle horizontally.

y double

The amount to inflate the copy of the rectangle vertically.

Returns

RRect

The inflated RRect.

Inflate(RSize)

Inflates this RRect by the specified amount.

public void Inflate(RSize size)

Parameters

size RSize

The amount to inflate this rectangle.

Intersect(RRect)

Replaces this RRect structure with the intersection of itself and the specified RRect structure.

public void Intersect(RRect rect)

Parameters

rect RRect

The rectangle to intersect.

Intersect(RRect, RRect)

Returns a RRect structure that represents the intersection of two rectangles. If there is no intersection, and empty RRect is returned.

public static RRect Intersect(RRect a, RRect b)

Parameters

a RRect

A rectangle to intersect.

b RRect

A rectangle to intersect.

Returns

RRect

A third RRect structure the size of which represents the overlapped area of the two specified rectangles.

IntersectsWith(RRect)

Determines if this rectangle intersects with rect.

public bool IntersectsWith(RRect rect)

Parameters

rect RRect

The rectangle to test.

Returns

bool

This method returns true if there is any intersection.

Offset(double, double)

Adjusts the location of this rectangle by the specified amount.

public void Offset(double x, double y)

Parameters

x double

The amount to offset the location horizontally.

y double

The amount to offset the location vertically.

Offset(RPoint)

Adjusts the location of this rectangle by the specified amount.

public void Offset(RPoint pos)

Parameters

pos RPoint

The amount to offset the location.

ToString()

Converts the Location and Size of this RRect to a human-readable string.

public override string ToString()

Returns

string

A string that contains the position, width, and height of this RRect structure for example, "{X=20, Y=20, Width=100, Height=50}".

Union(RRect, RRect)

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

public static RRect Union(RRect a, RRect b)

Parameters

a RRect

A rectangle to union.

b RRect

A rectangle to union.

Returns

RRect

A third RRect structure that contains both of the two rectangles that form the union.

Operators

operator ==(RRect, RRect)

Tests whether two RRect structures have equal location and size.

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

Parameters

left RRect

The RRect structure that is to the left of the equality operator.

right RRect

The RRect structure that is to the right of the equality operator.

Returns

bool

This operator returns true if the two specified RRect structures have equal X, Y, Width, and Height properties.

operator !=(RRect, RRect)

Tests whether two RRect structures differ in location or size.

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

Parameters

left RRect

The RRect structure that is to the left of the inequality operator.

right RRect

The RRect structure that is to the right of the inequality operator.

Returns

bool

This operator returns true if any of the X , Y, Width, or Height properties of the two RRect structures are unequal; otherwise false.