-
- All Known Implementing Classes:
AbstractMultiResolutionImage,BaseMultiResolutionImage
public interface MultiResolutionImageThis interface is designed to be an optional additional API supported by some implementations ofImageto allow them to provide alternate images for various rendering resolutions. The variousGraphics.drawImage(...)variant methods will consult the methods of this interface if it is implemented on the argumentImageobject in order to choose the best representation to use for each rendering operation.The
MultiResolutionImageinterface should be implemented by any subclass ofjava.awt.Imagewhose instances are intended to provide image resolution variants according to the given image width and height. For convenience, toolkit images obtained fromToolkit.getImage(String name)andToolkit.getImage(URL url)will implement this interface on platforms that support naming conventions for resolution variants of stored image media and theAbstractMultiResolutionImageandBaseMultiResolutionImageclasses are provided to facilitate easy construction of custom multi-resolution images from a list of related images.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ImagegetResolutionVariant(double destImageWidth, double destImageHeight)Gets a specific image that is the best variant to represent this logical image at the indicated size.List<Image>getResolutionVariants()Gets a readable list of all resolution variants.
-
-
-
Method Detail
-
getResolutionVariant
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- the width of the destination image, in pixels.destImageHeight- the height of the destination image, in pixels.- Returns:
- image resolution variant.
- Throws:
IllegalArgumentException- ifdestImageWidthordestImageHeightis less than or equal to zero, infinity, or NaN.- Since:
- 9
-
-