Image methods
for classes that want to implement the MultiResolutionImage
interface.
For example,
public class CustomMultiResolutionImage extends AbstractMultiResolutionImage {
final Image[] resolutionVariants;
public CustomMultiResolutionImage(Image... resolutionVariants) {
this.resolutionVariants = resolutionVariants;
}
public Image getResolutionVariant(
double destImageWidth, double destImageHeight) {
// return a resolution variant based on the given destination image size
}
public List<Image> getResolutionVariants() {
return Collections.unmodifiableList(Arrays.asList(resolutionVariants));
}
protected Image getBaseImage() {
return resolutionVariants[0];
}
}
java.awt.Image , java.awt.image.MultiResolutionImage
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract Image | Returns: the base image of the set of multi-resolution imagesReturn the base image representing the best version of the image for rendering at the default width and height. |
| public Graphics | Returns: throwsUnsupportedOperationExceptionImplements abstract java. As per the contract of the base |
| public int | Returns: the height of the base image, or -1 if the height is not yet knownImplements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to: |
| public Object | Returns: the value of the named property in the base imageImplements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to: |
| public ImageProducer | Returns: the image producer that produces the pixels for the base imageImplements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to: |
| public int | Returns: the width of the base image, or -1 if the width is not yet knownImplements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to: |
| AbstractMultiResolutionImage | back to summary |
|---|---|
| protected AbstractMultiResolutionImage() Constructor for subclasses to call. | |
| getBaseImage | back to summary |
|---|---|
| protected abstract Image getBaseImage() Return the base image representing the best version of the image for rendering at the default width and height.
| |
| getGraphics | back to summary |
|---|---|
| public Graphics getGraphics() Implements abstract java. As per the contract of the base
| |
| getHeight | back to summary |
|---|---|
| public int getHeight(ImageObserver observer) Implements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to:
| |
| getProperty | back to summary |
|---|---|
| public Object getProperty(String name, ImageObserver observer) Implements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to:
| |
| getSource | back to summary |
|---|---|
| public ImageProducer getSource() Implements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to:
| |
| getWidth | back to summary |
|---|---|
| public int getWidth(ImageObserver observer) Implements abstract java. This method simply delegates to the same method on the base image and
it is equivalent to:
| |