AbstractMultiResolutionImage
, BaseMultiResolutionImage
public interface MultiResolutionImage
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.
Modifier and Type | Method | Description |
---|---|---|
Image |
getResolutionVariant |
Gets a specific image that is the best variant to represent this logical image at the indicated size. |
List |
getResolutionVariants() |
Gets a readable list of all resolution variants. |
Image getResolutionVariant(double destImageWidth, double destImageHeight)
destImageWidth
- the width of the destination image, in pixels.destImageHeight
- the height of the destination image, in pixels.IllegalArgumentException
- if destImageWidth
or destImageHeight
is less than or equal to zero, infinity, or NaN.List<Image> getResolutionVariants()
Note that many implementations might return an unmodifiable list.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/image/MultiResolutionImage.html