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 SourceDp(int)
Converter int dp to pixel.
Declaration
public static int Dp(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. |
Dp(float)
Converter float dp to pixel.
Declaration
public static float Dp(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. |
DpToPt(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. |
PtToSdp(float)
Converter float font point size to sdp size.
Declaration
public static float PtToSdp(this float pt)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pt | The float point unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| float | The float sdp 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. |
PxToSdp(int)
Converter int pixel to sdp.
Declaration
public static int PxToSdp(this int pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pixel | The int pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| int | The int sdp unit value. |
PxToSdp(float)
Converter float pixel to sdp.
Declaration
public static float PxToSdp(this float pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| float | pixel | The float pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| float | The float sdp unit value. |
PxToSdp(Extents)
Converter Extents pixel to sdp.
Declaration
public static Extents PxToSdp(this Extents pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Extents | pixel | The Extents pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| Extents | The Extents sdp unit value. |
PxToSdp(Position)
Converter Position pixel to sdp.
Declaration
public static Position PxToSdp(this Position pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | pixel | The Position pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| Position | The Position sdp unit value. |
PxToSdp(Position2D)
Converter Position2D pixel to sdp.
Declaration
public static Position2D PxToSdp(this Position2D pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | pixel | The Position2D pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| Position2D | The Position2D sdp unit value. |
PxToSdp(Rectangle)
Converter Rectangle pixel to sdp.
Declaration
public static Rectangle PxToSdp(this Rectangle pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | pixel | The Rectangle pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| Rectangle | The Rectangle sdp unit value. |
PxToSdp(Size)
Converter Size pixel to sdp.
Declaration
public static Size PxToSdp(this Size pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | pixel | The Size pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| Size | The Size sdp unit value. |
PxToSdp(Size2D)
Converter Size2D pixel to sdp.
Declaration
public static Size2D PxToSdp(this Size2D pixel)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | pixel | The Size2D pixel unit value to be converted sdp unit. |
Returns
| Type | Description |
|---|---|
| Size2D | The Size2D sdp 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. |
Sdp(int)
Converter int sdp to pixel.
Declaration
public static int Sdp(this int sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| int | sdp | The int sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| int | The int pixel unit value. |
Sdp(float)
Converter float scaled dp to pixel.
Declaration
public static float Sdp(this float sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | sdp | The float scaled dp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| float | The float pixel unit value. |
SdpToPt(float)
Converter float font sdp size to point size.
Declaration
public static float SdpToPt(this float sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | sdp | The float sdp unit value to be converted point unit. |
Returns
| Type | Description |
|---|---|
| float | The float point unit value. |
SdpToPx(Extents)
Converter Extents sdp to pixel.
Declaration
public static Extents SdpToPx(this Extents sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Extents | sdp | The Extents sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Extents | The Extents pixel unit value. |
SdpToPx(Position)
Converter Position sdp to pixel.
Declaration
public static Position SdpToPx(this Position sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Position | sdp | The Position sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Position | The Position pixel unit value. |
SdpToPx(Position2D)
Converter Position2D sdp to pixel.
Declaration
public static Position2D SdpToPx(this Position2D sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Position2D | sdp | The Position2D sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Position2D | The Position2D pixel unit value. |
SdpToPx(Rectangle)
Converter Rectangle sdp to pixel.
Declaration
public static Rectangle SdpToPx(this Rectangle sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Rectangle | sdp | The Rectangle sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Rectangle | The Rectangle pixel unit value. |
SdpToPx(Size)
Converter Size sdp to pixel.
Declaration
public static Size SdpToPx(this Size sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | sdp | The Size sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Size | The Size pixel unit value. |
SdpToPx(Size2D)
Converter Size2D sdp to pixel.
Declaration
public static Size2D SdpToPx(this Size2D sdp)
Parameters
| Type | Name | Description |
|---|---|---|
| Size2D | sdp | The Size2D sdp unit value to be converted pixel unit. |
Returns
| Type | Description |
|---|---|
| Size2D | The Size2D pixel 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 scaled dp to pixel.
Declaration
public static float SpToPx(this float sp)
Parameters
| Type | Name | Description |
|---|---|---|
| float | sp | The float scaled dp 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. |
Spx(int)
Converter int pixel to scaled pixel.
Declaration
public static int Spx(this int px)
Parameters
| Type | Name | Description |
|---|---|---|
| int | px | The int pixel value to be scaled. |
Returns
| Type | Description |
|---|---|
| int | The int scaled pixel unit value. |
Spx(float)
Converter float pixel to scaled pixel.
Declaration
public static float Spx(this float px)
Parameters
| Type | Name | Description |
|---|---|---|
| float | px | The float pixel value to be scaled. |
Returns
| Type | Description |
|---|---|
| float | The float scaled pixel unit value. |