Multi-resolution Images
The purpose of Java Enhancement Proposal 251 was to create a new API that supports multi-resolution images. Specifically, to allow a multi-resolution image to encapsulate several resolution variants of the same image. This new API will be located in the java.awt.image
package. The following diagram shows how multi-resolution can encapsulate a set of images, with different resolutions, into a single image:
This new API will give developers the ability to retrieve all image variants or retrieve a resolution-specific image. This is a powerful set of capabilities. The java.awt.Graphics
class will be used to retrieve the desired variant from the multi-resolution image.
Here is a quick look at the API:
package java.awt.image; public interface MultiResolutionImage { Image getResolutionVariant(float destinationImageWidth, float destinationImageHeight); public List <Image> getResolutionVariants(); }
As you can see in the preceding code...