public class ImageSize
extends java.lang.Object
Constructor and Description |
---|
ImageSize()
Default Constructor.
|
ImageSize(int widthPx,
int heightPx,
double dpi)
Constructor.
|
ImageSize(int widthPx,
int heightPx,
double dpiHorizontal,
double dpiVertical)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
calcPixelsFromSize()
Calculates the size in pixels based on the size in millipoints and the resolution.
|
void |
calcSizeFromPixels()
Calculates the size in millipoints based on the size in pixels and the resolution.
|
int |
getBaselinePositionFromBottom()
Returns the vertical position of the baseline of the image relative to the bottom of the
image.
|
java.awt.Dimension |
getDimensionMpt()
Returns the size in millipoints as a Dimension object.
|
java.awt.geom.Dimension2D |
getDimensionPt()
Returns the size in points as a Dimension2D object.
|
java.awt.Dimension |
getDimensionPx()
Returns the size in pixels as a Dimension object.
|
double |
getDpiHorizontal()
Returns the image's horizontal resolution in dpi (dots per inch).
|
double |
getDpiVertical()
Returns the image's vertical resolution in dpi (dots per inch).
|
int |
getHeightMpt()
Returns the image's height in millipoints.
|
int |
getHeightPx()
Returns the image's height in pixels.
|
int |
getWidthMpt()
Returns the image's width in millipoints.
|
int |
getWidthPx()
Returns the image's width in pixels.
|
void |
setBaselinePositionFromBottom(int distance)
Sets the vertical position of the baseline of the image relative to the bottom of the image.
|
void |
setResolution(double resolution)
Sets the image's resolution for interpreting the pixel size.
|
void |
setResolution(double horizontal,
double vertical)
Sets the image's resolution for interpreting the pixel size.
|
void |
setSizeInMillipoints(int width,
int height)
Sets the image's size in millipoints.
|
void |
setSizeInPixels(int width,
int height)
Sets the image's size in pixels.
|
java.lang.String |
toString() |
public ImageSize(int widthPx, int heightPx, double dpiHorizontal, double dpiVertical)
widthPx
- the width of the image in pixelsheightPx
- the height of the image in pixelsdpiHorizontal
- the horizontal resolution in dots per inchdpiVertical
- the vertical resolution in dots per inchpublic ImageSize(int widthPx, int heightPx, double dpi)
widthPx
- the width of the image in pixelsheightPx
- the height of the image in pixelsdpi
- the resolution in dots per inchpublic ImageSize()
public void setSizeInPixels(int width, int height)
width
- the width in pixelsheight
- the height in pixelspublic void setSizeInMillipoints(int width, int height)
width
- the width in millipointsheight
- the height in millipointspublic void setResolution(double horizontal, double vertical)
horizontal
- the horizontal resolution in dpivertical
- the vertical resolution in dpipublic void setResolution(double resolution)
resolution
- the resolution in dpipublic void setBaselinePositionFromBottom(int distance)
distance
- the distance from the bottom of the image in millipointspublic int getBaselinePositionFromBottom()
public int getWidthPx()
public int getHeightPx()
public int getWidthMpt()
public int getHeightMpt()
public double getDpiHorizontal()
public double getDpiVertical()
public java.awt.Dimension getDimensionMpt()
public java.awt.geom.Dimension2D getDimensionPt()
public java.awt.Dimension getDimensionPx()
public void calcSizeFromPixels()
public void calcPixelsFromSize()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.