public class UnitConverter extends Object
| Modifier and Type | Field and Description |
|---|---|
static float |
DefaultDpi |
| Constructor and Description |
|---|
UnitConverter() |
| Modifier and Type | Method and Description |
|---|---|
static double |
inchesToPoints(double inches)
Converts inches to points.
|
static double |
pixelsToPoints(double pixels)
Converts pixels to points at 96 dpi.
|
static double |
pixelsToPoints(double pixels,
int dimension)
Converts pixels to points at system dpi.
|
static double |
pointsToInches(double points)
Converts points to inches.
|
static double |
pointsToPixels(double points)
Converts points to pixels at 96 dpi.
|
static double |
pointsToPixels(double pixels,
int dimension)
Converts points to pixels at system dpi.
|
static int |
signedByteToUnsignedInt(byte value) |
public static final float DefaultDpi
public static double inchesToPoints(double inches)
Converts inches to points.
inches - The value to convert.public static double pixelsToPoints(double pixels)
Converts pixels to points at 96 dpi.
pixels - The value to convert.public static double pixelsToPoints(double pixels,
int dimension)
Converts pixels to points at system dpi.
pixels - The value to convert.dimension - Measured dimension.
If width, then system horizontal resolution is used; otherwise - vertical resolution.public static double pointsToInches(double points)
Converts points to inches.
points - The value to convert.public static double pointsToPixels(double points)
Converts points to pixels at 96 dpi.
points - The value to convert.public static double pointsToPixels(double pixels,
int dimension)
Converts points to pixels at system dpi.
pixels - The value to convert.dimension - Measured dimension.
If width, then system horizontal resolution is used; otherwise - vertical resolution.public static int signedByteToUnsignedInt(byte value)
Copyright © 2026. All rights reserved.