Class SharpDXRectExtensions
Extension methods for the SharpDX rectangle and rectanglef types.
Inherited Members
Namespace: Gorgon.Graphics
Assembly: Gorgon.Core.dll
Syntax
public static class SharpDXRectExtensions
Methods
| Edit this page View SourceCeiling(RectangleF)
Function to set the rectangle coordinates to the nearest integer values that are higher than or equal to the original values.
Declaration
public static RectangleF Ceiling(this RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | The rectangle to floor. |
Returns
Type | Description |
---|---|
RectangleF | The truncated rectangle. |
Contains(Rectangle, Point)
Function to determine if a point is contained within a rectangle.
Declaration
public static bool Contains(this Rectangle rect, Point point)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rect | The rectangle to evaluate. |
Point | point | The point to evaluate. |
Returns
Type | Description |
---|---|
bool | true if the point lies within the rectangle, false if not. |
Contains(RectangleF, RectangleF)
Determines whether this rectangle entirely contains a specified rectangle.
Declaration
public static bool Contains(this RectangleF rect, RectangleF value)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | The source rectangle to compare. |
RectangleF | value | The rectangle to evaluate. |
Returns
Type | Description |
---|---|
bool | true if the rectangle is contained within the other rectangle, or false if not. |
Equals(in Rectangle, in Rectangle)
Function to compare rectangles for equality using a read only reference.
Declaration
public static bool Equals(this in Rectangle thisRect, in Rectangle other)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | thisRect | The rectangle being compared. |
Rectangle | other | The other view being compared. |
Returns
Type | Description |
---|---|
bool | true if the two instances are equal, false if not. |
Equals(in RectangleF, in RectangleF)
Function to compare rectangles for equality using a read only reference.
Declaration
public static bool Equals(this in RectangleF thisRect, in RectangleF other)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | thisRect | The rectangle being compared. |
RectangleF | other | The other view being compared. |
Returns
Type | Description |
---|---|
bool | true if the two instances are equal, false if not. |
Equals(in ViewportF, in ViewportF)
Function to compare viewports for equality using a read only reference.
Declaration
public static bool Equals(this in ViewportF thisView, in ViewportF other)
Parameters
Type | Name | Description |
---|---|---|
ViewportF | thisView | The view being compared. |
ViewportF | other | The other view being compared. |
Returns
Type | Description |
---|---|
bool | true if the two instances are equal, false if not. |
Floor(RectangleF)
Function to set the rectangle coordinates to the nearest integer values that are lower than or equal to the original values.
Declaration
public static RectangleF Floor(this RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | The rectangle to floor. |
Returns
Type | Description |
---|---|
RectangleF | The truncated rectangle. |
ToRectangle(RectangleF)
Function to convert a floating point rectangle to an integer rectangle/
Declaration
public static Rectangle ToRectangle(this RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | The rectangle to convert. |
Returns
Type | Description |
---|---|
Rectangle | The converted rectangle. |
Remarks
This method converts the coordinates to integer values without applying rounding.
ToRectangleF(Rectangle)
Function to convert an integer rectangle to a floating point rectangle/
Declaration
public static RectangleF ToRectangleF(this Rectangle rect)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rect | The rectangle to convert. |
Returns
Type | Description |
---|---|
RectangleF | The converted rectangle. |
Truncate(RectangleF)
Function to truncate the rectangle coordinates to the whole number portion of their values.
Declaration
public static RectangleF Truncate(this RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | The rectangle to truncate. |
Returns
Type | Description |
---|---|
RectangleF | The truncated rectangle. |
Remarks
This method converts the coordinates to integer values without applying rounding.