Class GraphicsTypeExtensions
Definition
- Assembly:
- Tizen.NUI.dll
The GraphicTypeExtensions class is graphics type converter for pixel based object. Density independent pixel(dp) unit is our basic target type and you can get converted value by PxToDp(), and you can get original pixel by PxToDp(). One dp is a virtual pixel unit that's roughly equal to one pixel on a medium-density(160dpi) screen. See GraphicsTypeManager and GraphicsTypeConverter also.
public static class GraphicsTypeExtensions
- Inheritance
-
objectGraphicsTypeExtensions
Methods
View SourceDpToPt(float)
Converter float font dp size to point size. 16.0f.DpToPt() = 7.2f.
Declaration
public static float DpToPt(this float dp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | dp | The float dp unit value to be converted point unit. |
Returns
| Type | Description |
|---|---|
| float | The float point unit value. |
DpToPx(int)
Converter int dp to pixel.
Declaration
public static int DpToPx(this int dp)
Parameters
| Type | Name | Description |
|---|---|---|
| int | dp | The int dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| int | The int pixel unit value. |
DpToPx(float)
Converter float dp to pixel.
Declaration
public static float DpToPx(this float dp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | dp | The float dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| float | The float pixel unit value. |
DpToPx(Extents)
Converter Extents dp to pixel.
Declaration
public static Extents DpToPx(this Extents dp)
Parameters
| Type | Name | Description |
|---|---|---|
| Extents | dp | The Extents dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Extents | The Extents pixel unit value. |
DpToPx(Position)
Converter Position dp to pixel.
Declaration
public static Position DpToPx(this Position dp)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | dp | The Position dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Position | The Position pixel unit value. |
DpToPx(Position2D)
Converter Position2D dp to pixel.
Declaration
public static Position2D DpToPx(this Position2D dp)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | dp | The Position2D dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Position2D | The Position2D pixel unit value. |
DpToPx(Rectangle)
Converter Rectangle dp to pixel.
Declaration
public static Rectangle DpToPx(this Rectangle dp)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | dp | The Rectangle dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Rectangle | The Rectangle pixel unit value. |
DpToPx(Size)
Converter Size dp to pixel.
Declaration
public static Size DpToPx(this Size dp)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | dp | The Size dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Size | The Size pixel unit value. |
DpToPx(Size2D)
Converter Size2D dp to pixel.
Declaration
public static Size2D DpToPx(this Size2D dp)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | dp | The Size2D dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Size2D | The Size2D pixel unit value. |
PtToDp(float)
Converter float font point size to dp size. 7.2f.PtToDp() = 16.0f.
Declaration
public static float PtToDp(this float pt)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pt | The float point unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| float | The float dp unit value. |
PtToPx(float)
Converter float font point size to pixel size.
Declaration
public static float PtToPx(this float pt)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pt | The float point unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| float | The float pixel unit value. |
PtToSp(float)
Converter float font point size to sp size.
Declaration
public static float PtToSp(this float pt)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pt | The float point unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| float | The float dp unit value. |
PxToDp(int)
Converter int pixel to dp.
Declaration
public static int PxToDp(this int pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pixel | The int pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| int | The int dp unit value. |
PxToDp(float)
Converter float pixel to dp.
Declaration
public static float PxToDp(this float pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pixel | The float pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| float | The float dp unit value. |
PxToDp(Extents)
Converter Extents pixel to dp.
Declaration
public static Extents PxToDp(this Extents pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Extents | pixel | The Extents pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| Extents | The Extents dp unit value. |
PxToDp(Position)
Converter Position pixel to dp.
Declaration
public static Position PxToDp(this Position pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | pixel | The Position pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| Position | The Position dp unit value. |
PxToDp(Position2D)
Converter Position2D pixel to dp.
Declaration
public static Position2D PxToDp(this Position2D pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | pixel | The Position2D pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| Position2D | The Position2D dp unit value. |
PxToDp(Rectangle)
Converter Rectangle pixel to dp.
Declaration
public static Rectangle PxToDp(this Rectangle pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | pixel | The Rectangle pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| Rectangle | The Rectangle dp unit value. |
PxToDp(Size)
Converter Size pixel to dp.
Declaration
public static Size PxToDp(this Size pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | pixel | The Size pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| Size | The Size dp unit value. |
PxToDp(Size2D)
Converter Size2D pixel to dp.
Declaration
public static Size2D PxToDp(this Size2D pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | pixel | The Size2D pixel unit value to be converted dp unit. |
Returns
| Type | Description |
|---|---|
| Size2D | The Size2D dp unit value. |
PxToPt(float)
Converter float font pixel size to point size.
Declaration
public static float PxToPt(this float pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pixel | The float pixel unit value to be converted point unit. |
Returns
| Type | Description |
|---|---|
| float | The float point unit value. |
PxToSp(int)
Converter int pixel to sp.
Declaration
public static int PxToSp(this int pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pixel | The int pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| int | The int sp unit value. |
PxToSp(float)
Converter float pixel to sp.
Declaration
public static float PxToSp(this float pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pixel | The float pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| float | The float sp unit value. |
PxToSp(Extents)
Converter Extents pixel to sp.
Declaration
public static Extents PxToSp(this Extents pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Extents | pixel | The Extents pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| Extents | The Extents sp unit value. |
PxToSp(Position)
Converter Position pixel to sp.
Declaration
public static Position PxToSp(this Position pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | pixel | The Position pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| Position | The Position sp unit value. |
PxToSp(Position2D)
Converter Position2D pixel to sp.
Declaration
public static Position2D PxToSp(this Position2D pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | pixel | The Position2D pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| Position2D | The Position2D sp unit value. |
PxToSp(Rectangle)
Converter Rectangle pixel to sp.
Declaration
public static Rectangle PxToSp(this Rectangle pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | pixel | The Rectangle pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| Rectangle | The Rectangle sp unit value. |
PxToSp(Size)
Converter Size pixel to sp.
Declaration
public static Size PxToSp(this Size pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | pixel | The Size pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| Size | The Size sp unit value. |
PxToSp(Size2D)
Converter Size2D pixel to sp.
Declaration
public static Size2D PxToSp(this Size2D pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | pixel | The Size2D pixel unit value to be converted sp unit. |
Returns
| Type | Description |
|---|---|
| Size2D | The Size2D sp unit value. |
SpToPt(float)
Converter float font sp size to point size.
Declaration
public static float SpToPt(this float sp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | sp | The float sp unit value to be converted point unit. |
Returns
| Type | Description |
|---|---|
| float | The float point unit value. |
SpToPx(int)
Converter int dp to pixel.
Declaration
public static int SpToPx(this int sp)
Parameters
| Type | Name | Description |
|---|---|---|
| int | sp | The int sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| int | The int pixel unit value. |
SpToPx(float)
Converter float sp to pixel.
Declaration
public static float SpToPx(this float sp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | sp | The float sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| float | The float pixel unit value. |
SpToPx(Extents)
Converter Extents sp to pixel.
Declaration
public static Extents SpToPx(this Extents sp)
Parameters
| Type | Name | Description |
|---|---|---|
| Extents | sp | The Extents sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Extents | The Extents pixel unit value. |
SpToPx(Position)
Converter Position sp to pixel.
Declaration
public static Position SpToPx(this Position sp)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | sp | The Position sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Position | The Position pixel unit value. |
SpToPx(Position2D)
Converter Position2D sp to pixel.
Declaration
public static Position2D SpToPx(this Position2D sp)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | sp | The Position2D sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Position2D | The Position2D pixel unit value. |
SpToPx(Rectangle)
Converter Rectangle sp to pixel.
Declaration
public static Rectangle SpToPx(this Rectangle sp)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | sp | The Rectangle sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Rectangle | The Rectangle pixel unit value. |
SpToPx(Size)
Converter Size sp to pixel.
Declaration
public static Size SpToPx(this Size sp)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | sp | The Size sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Size | The Size pixel unit value. |
SpToPx(Size2D)
Converter Size2D sp to pixel.
Declaration
public static Size2D SpToPx(this Size2D sp)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | sp | The Size2D sp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Size2D | The Size2D pixel unit value. |