Class LengthUtil
java.lang.Object
net.sf.jasperreports.engine.export.LengthUtil
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Method Summary
Modifier and TypeMethodDescriptionstatic intemu(float pixels, int dpi) Convert an int value from pixels to EMUstatic inthalfPoint(float pixels, int dpi) static doubleinch(double pixels, int dpi) Converts pixels to inches without decimal truncation.static doubleinchFloor2Dec(double pixels, int dpi) static doubleinchFloor4Dec(double pixels, int dpi) static doubleinchRound2Dec(double pixels, int dpi) static doubleinchRound4Dec(double pixels, int dpi) static intpixel(float points, int dpi) Converts points back to pixels, the inverse ofpoint(float, int).static floatpoint(float pixels, int dpi) Converts pixels to points, for output formats that only offer a fixed set of line thicknesses and thus need the value expressed in physical units.static inttwip(float pixels, int dpi) Convert a float value to twips
-
Method Details
-
inch
public static double inch(double pixels, int dpi) Converts pixels to inches without decimal truncation. -
inchFloor2Dec
public static double inchFloor2Dec(double pixels, int dpi) -
inchFloor4Dec
public static double inchFloor4Dec(double pixels, int dpi) -
inchRound2Dec
public static double inchRound2Dec(double pixels, int dpi) -
inchRound4Dec
public static double inchRound4Dec(double pixels, int dpi) -
twip
public static int twip(float pixels, int dpi) Convert a float value to twips- Parameters:
pixels- value that need to be converted- Returns:
- converted value in twips
-
emu
public static int emu(float pixels, int dpi) Convert an int value from pixels to EMU- Parameters:
pixels- value that needs to be converted- Returns:
- converted value in EMU
-
halfPoint
public static int halfPoint(float pixels, int dpi) -
point
public static float point(float pixels, int dpi) Converts pixels to points, for output formats that only offer a fixed set of line thicknesses and thus need the value expressed in physical units.- Parameters:
pixels- value that needs to be converted- Returns:
- converted value in points
-
pixel
public static int pixel(float points, int dpi) Converts points back to pixels, the inverse ofpoint(float, int).- Parameters:
points- value that needs to be converted- Returns:
- converted value in pixels
-