APIdia Launch Partner
Top Description Methods
java.awt.image

public Interface MultiResolutionImage

Known Direct Implementers
sun.awt.image.MultiResolutionToolkitImage, java.awt.image.AbstractMultiResolutionImage
Imports
java.awt.Image, java.util.List

This interface is designed to be an optional additional API supported by some implementations of java.awt.Image to allow them to provide alternate images for various rendering resolutions. The various Graphics.drawImage(...) variant methods will consult the methods of this interface if it is implemented on the argument Image object in order to choose the best representation to use for each rendering operation.

The MultiResolutionImage interface should be implemented by any subclass of java.awt.Image whose instances are intended to provide image resolution variants according to the given image width and height. For convenience, toolkit images obtained from Toolkit.getImage(String name) and Toolkit.getImage(URL url) will implement this interface on platforms that support naming conventions for resolution variants of stored image media and the AbstractMultiResolutionImage and BaseMultiResolutionImage classes are provided to facilitate easy construction of custom multi-resolution images from a list of related images.

Since
9
See Also
java.awt.Image, java.awt.image.AbstractMultiResolutionImage, java.awt.image.BaseMultiResolutionImage, java.awt.Toolkit#getImage(java.lang.String filename), java.awt.Toolkit#getImage(java.net.URL url)

Method Summary

Modifier and TypeMethod and Description
public Image

Returns:

image resolution variant.
getResolutionVariant
(double
the width of the destination image, in pixels.
destImageWidth
,
double
the height of the destination image, in pixels.
destImageHeight
)

Gets a specific image that is the best variant to represent this logical image at the indicated size.

public List<Image>

Returns:

list of resolution variants.
getResolutionVariants
()

Gets a readable list of all resolution variants.

Method Detail

getResolutionVariantback to summary
public Image getResolutionVariant(double destImageWidth, double destImageHeight)

Gets a specific image that is the best variant to represent this logical image at the indicated size.

Parameters
destImageWidth:double

the width of the destination image, in pixels.

destImageHeight:double

the height of the destination image, in pixels.

Returns:Image

image resolution variant.

Exceptions
IllegalArgumentException:
if destImageWidth or destImageHeight is less than or equal to zero, infinity, or NaN.
Since
9
getResolutionVariantsback to summary
public List<Image> getResolutionVariants()

Gets a readable list of all resolution variants. The list must be nonempty and contain at least one resolution variant.

Note that many implementations might return an unmodifiable list.

Returns:List<Image>

list of resolution variants.

Since
9