Class GraphicsTypeExtensions

Definition

Namespace:
Tizen.NUI
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.

C#
Copy
public static class GraphicsTypeExtensions : object
Inheritance
GraphicsTypeExtensions

Methods

View Source

DpToPt(Single)

Converter float font dp size to point size. 16.0f.DpToPt() = 7.2f.

Declaration
C#
Copy
public static float DpToPt(this float dp)
Parameters
Type Name Description
Single dp

The float dp unit value to be converted point unit.

Returns
Type Description
Single

The float point unit value.

View Source

DpToPx(Int32)

Converter int dp to pixel.

Declaration
C#
Copy
public static int DpToPx(this int dp)
Parameters
Type Name Description
Int32 dp

The int dp unit value to be converted pixel unit.

Returns
Type Description
Int32

The int pixel unit value.

View Source

DpToPx(Single)

Converter float dp to pixel.

Declaration
C#
Copy
public static float DpToPx(this float dp)
Parameters
Type Name Description
Single dp

The float dp unit value to be converted pixel unit.

Returns
Type Description
Single

The float pixel unit value.

View Source

DpToPx(Extents)

Converter Extents dp to pixel.

Declaration
C#
Copy
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.

View Source

DpToPx(Position)

Converter Position dp to pixel.

Declaration
C#
Copy
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.

View Source

DpToPx(Position2D)

Converter Position2D dp to pixel.

Declaration
C#
Copy
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.

View Source

DpToPx(Rectangle)

Converter Rectangle dp to pixel.

Declaration
C#
Copy
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.

View Source

DpToPx(Size)

Converter Size dp to pixel.

Declaration
C#
Copy
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.

View Source

DpToPx(Size2D)

Converter Size2D dp to pixel.

Declaration
C#
Copy
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.

View Source

PtToDp(Single)

Converter float font point size to dp size. 7.2f.PtToDp() = 16.0f.

Declaration
C#
Copy
public static float PtToDp(this float pt)
Parameters
Type Name Description
Single pt

The float point unit value to be converted dp unit.

Returns
Type Description
Single

The float dp unit value.

View Source

PtToPx(Single)

Converter float font point size to pixel size.

Declaration
C#
Copy
public static float PtToPx(this float pt)
Parameters
Type Name Description
Single pt

The float point unit value to be converted pixel unit.

Returns
Type Description
Single

The float pixel unit value.

View Source

PtToSp(Single)

Converter float font point size to sp size.

Declaration
C#
Copy
public static float PtToSp(this float pt)
Parameters
Type Name Description
Single pt

The float point unit value to be converted sp unit.

Returns
Type Description
Single

The float dp unit value.

View Source

PxToDp(Int32)

Converter int pixel to dp.

Declaration
C#
Copy
public static int PxToDp(this int pixel)
Parameters
Type Name Description
Int32 pixel

The int pixel unit value to be converted dp unit.

Returns
Type Description
Int32

The int dp unit value.

View Source

PxToDp(Single)

Converter float pixel to dp.

Declaration
C#
Copy
public static float PxToDp(this float pixel)
Parameters
Type Name Description
Single pixel

The float pixel unit value to be converted dp unit.

Returns
Type Description
Single

The float dp unit value.

View Source

PxToDp(Extents)

Converter Extents pixel to dp.

Declaration
C#
Copy
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.

View Source

PxToDp(Position)

Converter Position pixel to dp.

Declaration
C#
Copy
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.

View Source

PxToDp(Position2D)

Converter Position2D pixel to dp.

Declaration
C#
Copy
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.

View Source

PxToDp(Rectangle)

Converter Rectangle pixel to dp.

Declaration
C#
Copy
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.

View Source

PxToDp(Size)

Converter Size pixel to dp.

Declaration
C#
Copy
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.

View Source

PxToDp(Size2D)

Converter Size2D pixel to dp.

Declaration
C#
Copy
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.

View Source

PxToPt(Single)

Converter float font pixel size to point size.

Declaration
C#
Copy
public static float PxToPt(this float pixel)
Parameters
Type Name Description
Single pixel

The float pixel unit value to be converted point unit.

Returns
Type Description
Single

The float point unit value.

View Source

PxToSp(Int32)

Converter int pixel to sp.

Declaration
C#
Copy
public static int PxToSp(this int pixel)
Parameters
Type Name Description
Int32 pixel

The int pixel unit value to be converted sp unit.

Returns
Type Description
Int32

The int sp unit value.

View Source

PxToSp(Single)

Converter float pixel to sp.

Declaration
C#
Copy
public static float PxToSp(this float pixel)
Parameters
Type Name Description
Single pixel

The float pixel unit value to be converted sp unit.

Returns
Type Description
Single

The float sp unit value.

View Source

PxToSp(Extents)

Converter Extents pixel to sp.

Declaration
C#
Copy
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.

View Source

PxToSp(Position)

Converter Position pixel to sp.

Declaration
C#
Copy
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.

View Source

PxToSp(Position2D)

Converter Position2D pixel to sp.

Declaration
C#
Copy
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.

View Source

PxToSp(Rectangle)

Converter Rectangle pixel to sp.

Declaration
C#
Copy
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.

View Source

PxToSp(Size)

Converter Size pixel to sp.

Declaration
C#
Copy
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.

View Source

PxToSp(Size2D)

Converter Size2D pixel to sp.

Declaration
C#
Copy
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.

View Source

SpToPt(Single)

Converter float font sp size to point size.

Declaration
C#
Copy
public static float SpToPt(this float sp)
Parameters
Type Name Description
Single sp

The float sp unit value to be converted point unit.

Returns
Type Description
Single

The float point unit value.

View Source

SpToPx(Int32)

Converter int dp to pixel.

Declaration
C#
Copy
public static int SpToPx(this int sp)
Parameters
Type Name Description
Int32 sp

The int sp unit value to be converted pixel unit.

Returns
Type Description
Int32

The int pixel unit value.

View Source

SpToPx(Single)

Converter float sp to pixel.

Declaration
C#
Copy
public static float SpToPx(this float sp)
Parameters
Type Name Description
Single sp

The float sp unit value to be converted pixel unit.

Returns
Type Description
Single

The float pixel unit value.

View Source

SpToPx(Extents)

Converter Extents sp to pixel.

Declaration
C#
Copy
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.

View Source

SpToPx(Position)

Converter Position sp to pixel.

Declaration
C#
Copy
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.

View Source

SpToPx(Position2D)

Converter Position2D sp to pixel.

Declaration
C#
Copy
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.

View Source

SpToPx(Rectangle)

Converter Rectangle sp to pixel.

Declaration
C#
Copy
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.

View Source

SpToPx(Size)

Converter Size sp to pixel.

Declaration
C#
Copy
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.

View Source

SpToPx(Size2D)

Converter Size2D sp to pixel.

Declaration
C#
Copy
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.