C# Class CUE.NET.Helper.RectangleHelper

Show file Open project: DarthAffe/CUE.NET

Public Methods

Method Description
CalculateIntersectPercentage ( RectangleF rect, RectangleF referenceRect ) : float

Calculates the percentage of the intersection of two rectangles.

CreateRectangleFromPoints ( PointF point1, PointF point2 ) : RectangleF

Creates a rectangle from two corner points.

CreateRectangleFromRectangles ( IEnumerable rectangles ) : RectangleF

Creates a rectangle containing n other rectangles.

CreateRectangleFromRectangles ( RectangleF rectangle1, RectangleF rectangle2 ) : RectangleF

Creates a rectangle containing two other rectangles.

GetCenter ( this rectangle, float offsetX = 0f, float offsetY = 0f ) : PointF

Calculates the center-point of a rectangle adding an offset.

Move ( this rectangle, float offsetX = 0f, float offsetY = 0f ) : RectangleF

Moves a rectangle by a adding an offset.

Method Details

CalculateIntersectPercentage() public static method

Calculates the percentage of the intersection of two rectangles.
public static CalculateIntersectPercentage ( RectangleF rect, RectangleF referenceRect ) : float
rect System.Drawing.RectangleF The rectangle from which the percentage should be calculated.
referenceRect System.Drawing.RectangleF The intersecting rectangle.
return float

CreateRectangleFromPoints() public static method

Creates a rectangle from two corner points.
public static CreateRectangleFromPoints ( PointF point1, PointF point2 ) : RectangleF
point1 System.Drawing.PointF The first point.
point2 System.Drawing.PointF The second points.
return System.Drawing.RectangleF

CreateRectangleFromRectangles() public static method

Creates a rectangle containing n other rectangles.
public static CreateRectangleFromRectangles ( IEnumerable rectangles ) : RectangleF
rectangles IEnumerable The list of rectangles.
return System.Drawing.RectangleF

CreateRectangleFromRectangles() public static method

Creates a rectangle containing two other rectangles.
public static CreateRectangleFromRectangles ( RectangleF rectangle1, RectangleF rectangle2 ) : RectangleF
rectangle1 System.Drawing.RectangleF The first rectangle.
rectangle2 System.Drawing.RectangleF The second rectangle.
return System.Drawing.RectangleF

GetCenter() public static method

Calculates the center-point of a rectangle adding an offset.
public static GetCenter ( this rectangle, float offsetX = 0f, float offsetY = 0f ) : PointF
rectangle this The rectangle.
offsetX float The offset for the x-value
offsetY float The offset for the y-value
return System.Drawing.PointF

Move() public static method

Moves a rectangle by a adding an offset.
public static Move ( this rectangle, float offsetX = 0f, float offsetY = 0f ) : RectangleF
rectangle this The rectangle.
offsetX float The offset for the x-value
offsetY float The offset for the y-value
return System.Drawing.RectangleF