APIdia Launch Partner
Top Description Methods
com.sun.javafx.iio

public Interface ImageLoader

Known Direct Implementers
com.sun.javafx.iio.common.ImageLoaderImpl, com.sun.javafx.iio.java2d.J2DImageLoader
Imports
java.io.IOException

A loader for images stored in a given format.

Method Summary

Modifier and TypeMethod and Description
public void
addListener(ImageLoadListener
the listener to add.
listener
)

Adds a listener to monitor this loader.

public void
dispose()

Disposes of any resources (such as native libraries) held by this loader.

public ImageFormatDescription

Returns:

a description of the image format handled by this loader.
getFormatDescription
()

Gets a description of the image format supported by this loader.

public ImageFrame

Returns:

the image at the specified index or null on error.
load
(int
the zero-relative index of the image to load.
imageIndex
,
double
the desired image width. If non-positive, an IllegalArgumentException will be thrown.
width
,
double
the desired image height. If non-positive, an IllegalArgumentException will be thrown.
height
,
boolean
whether to preserve the width-to-height ratio of the image.
preserveAspectRatio
,
boolean
whether to use a smooth downscaling algorithm.
smooth
,
float
screen pixel scale (used for variable-density images)
screenPixelScale
,
float
image pixel scale (used for fixed-density images)
imagePixelScale
)

Loads the image at a given index in an image stream.

public void
removeListener(ImageLoadListener
the listener to remove.
listener
)

Removes a listener from the list of those monitoring this loader.

Method Detail

addListenerback to summary
public void addListener(ImageLoadListener listener)

Adds a listener to monitor this loader.

Parameters
listener:ImageLoadListener

the listener to add.

disposeback to summary
public void dispose()

Disposes of any resources (such as native libraries) held by this loader. Any further invocation of any methods on this object are undefined.

getFormatDescriptionback to summary
public ImageFormatDescription getFormatDescription()

Gets a description of the image format supported by this loader.

Returns:ImageFormatDescription

a description of the image format handled by this loader.

loadback to summary
public ImageFrame load(int imageIndex, double width, double height, boolean preserveAspectRatio, boolean smooth, float screenPixelScale, float imagePixelScale) throws IOException

Loads the image at a given index in an image stream. If no image exists at that index null will be returned.

Parameters
imageIndex:int

the zero-relative index of the image to load.

width:double

the desired image width. If non-positive, an IllegalArgumentException will be thrown.

height:double

the desired image height. If non-positive, an IllegalArgumentException will be thrown.

preserveAspectRatio:boolean

whether to preserve the width-to-height ratio of the image.

smooth:boolean

whether to use a smooth downscaling algorithm.

screenPixelScale:float

screen pixel scale (used for variable-density images)

imagePixelScale:float

image pixel scale (used for fixed-density images)

Returns:ImageFrame

the image at the specified index or null on error.

removeListenerback to summary
public void removeListener(ImageLoadListener listener)

Removes a listener from the list of those monitoring this loader.

Parameters
listener:ImageLoadListener

the listener to remove.