Class RectangleExtensions
Extensions for the Rectangle type.
Inherited Members
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. |