DisplayUnitsConverter
Inheritance: java.lang.Object
public final class DisplayUnitsConverter
The class contains the methods for converting values.
Methods
Method | Description |
---|---|
pointToPixel(float points, float dpi) | Converts points to pixels at the specified pixel resolution. |
pixelToPoint(int pixels, float dpi) | Converts pixels to points at the specified pixel resolution. |
inchToPoint(float inches) | Converts inches to points. |
pointToInch(float points) | Converts points to inches. |
millimeterToInch(float mm) | Converts millimeters to inches. |
millimeterToPoint(float mm) | Converts millimeters to points. |
pointToPixel(float points, float dpi)
public static int pointToPixel(float points, float dpi)
Converts points to pixels at the specified pixel resolution.
Parameters:
Parameter | Type | Description |
---|---|---|
points | float | The value to convert in points. |
dpi | float | Screen resolution. |
Returns: int - The int .
pixelToPoint(int pixels, float dpi)
public static float pixelToPoint(int pixels, float dpi)
Converts pixels to points at the specified pixel resolution.
Parameters:
Parameter | Type | Description |
---|---|---|
pixels | int | The value to convert in pixels. |
dpi | float | Screen resolution. |
Returns: float - The int .
inchToPoint(float inches)
public static float inchToPoint(float inches)
Converts inches to points.
Parameters:
Parameter | Type | Description |
---|---|---|
inches | float | The value to convert in inches. |
Returns: float - The float .
pointToInch(float points)
public static float pointToInch(float points)
Converts points to inches.
Parameters:
Parameter | Type | Description |
---|---|---|
points | float | The value to convert in points. |
Returns: float - The float .
millimeterToInch(float mm)
public static float millimeterToInch(float mm)
Converts millimeters to inches.
Parameters:
Parameter | Type | Description |
---|---|---|
mm | float | The value to convert in millimeters. |
Returns: float - The float .
millimeterToPoint(float mm)
public static float millimeterToPoint(float mm)
Converts millimeters to points.
Parameters:
Parameter | Type | Description |
---|---|---|
mm | float | The value to convert in millimeters. |
Returns: float - The float .