Show / Hide Table of Contents

Class RectangleExtensions

Extensions for the Rectangle type.

Inheritance
object
RectangleExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole
Assembly: SadConsole.dll
Syntax
public static class RectangleExtensions

Methods

ToConsole(Rectangle, Point)

Converts a rectangle from pixels to cells.

Declaration
public static Rectangle ToConsole(this Rectangle rect, Point fontSize)
Parameters
Type Name Description
Rectangle rect

The rectangle to work with.

Point fontSize

The font size used for translation.

Returns
Type Description
Rectangle

A new rectangle in cell coordinates.

ToConsole(Rectangle, int, int)

Converts a rectangle from pixels to cells.

Declaration
public static Rectangle ToConsole(this Rectangle rect, int cellWidth, int cellHeight)
Parameters
Type Name Description
Rectangle rect

The rectangle to work with.

int cellWidth

The width of a cell used in converting.

int cellHeight

The height of a cell used in converting.

Returns
Type Description
Rectangle

A new rectangle in cell coordinates.

ToPixels(Rectangle, Point)

Converts a rectangle from cells to pixels.

Declaration
public static Rectangle ToPixels(this Rectangle rect, Point fontSize)
Parameters
Type Name Description
Rectangle rect

The rectangle to work with.

Point fontSize

The font size used for translation.

Returns
Type Description
Rectangle

A new rectangle in pixels.

ToPixels(Rectangle, int, int)

Converts a rectangle from cells to pixels.

Declaration
public static Rectangle ToPixels(this Rectangle rect, int cellWidth, int cellHeight)
Parameters
Type Name Description
Rectangle rect

The rectangle to work with.

int cellWidth

The width of a cell used in converting.

int cellHeight

The height of a cell used in converting.

Returns
Type Description
Rectangle

A new rectangle in pixels.

In this article

Back to top

Back to top Generated by DocFX