public class PictureMaker extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CREATE_OPTION_DONT_SCALE_UP |
static int |
CREATE_OPTION_KEEP_ASPECT_RATIO |
Constructor and Description |
---|
PictureMaker(FormattedDataSource source) |
Modifier and Type | Method and Description |
---|---|
void |
cancelDecode()
This must be called if no decoding is to be done - it will close the data source.
|
void |
getNewSize(Dimension destination) |
int |
getOriginalHeight() |
Dimension |
getOriginalSize() |
void |
getOriginalSize(Dimension destination) |
int |
getOriginalWidth() |
PictureMaker |
select(int sourceX,
int sourceY,
int sourceWidth,
int sourceHeight,
int newWidth,
int newHeight,
int createOptions) |
PictureMaker |
select(Rect sourceArea,
Dimension newSize,
int createOptions) |
Image |
toImage()
Decode and return the formatted image as an Image.
|
void |
toImage(Image destination,
int x,
int y)
Write the formatted image to an Image or create a new Image and write the formatted image to it.
|
void |
toImageMaker(ImageMaker maker) |
Picture |
toPicture()
Create and return a Picture from the source with the specified source area and new width and new height.
|
PixelBuffer |
toPixelBuffer()
Decode and return the formatted image as a PixelBuffer.
|
void |
toPixelBuffer(PixelBuffer destination,
int x,
int y)
Write the formatted image to a PixelBuffer or create a new PixelBuffer and write the formatted image to it.
|
public static final int CREATE_OPTION_KEEP_ASPECT_RATIO
public static final int CREATE_OPTION_DONT_SCALE_UP
public PictureMaker(FormattedDataSource source) throws ImageDecodingException
source
- ImageDecodingException
public PictureMaker select(int sourceX, int sourceY, int sourceWidth, int sourceHeight, int newWidth, int newHeight, int createOptions)
public PictureMaker select(Rect sourceArea, Dimension newSize, int createOptions)
public int getOriginalWidth()
public int getOriginalHeight()
public Dimension getOriginalSize()
public void getOriginalSize(Dimension destination)
public void getNewSize(Dimension destination)
public void cancelDecode()
public Picture toPicture() throws ImageDecodingException
ImageDecodingException
public void toImageMaker(ImageMaker maker) throws ImageDecodingException
ImageDecodingException
public void toImage(Image destination, int x, int y)
destination
- the destination image.x
- the x-offset in the image.y
- the y-offset in the image.public void toPixelBuffer(PixelBuffer destination, int x, int y)
destination
- the destination image.x
- the x-offset in the image.y
- the y-offset in the image.public Image toImage()
public PixelBuffer toPixelBuffer()