public class ComponentImage.EncodedWrapper

  1. Object
  2. Image
  3. EncodedImage
  4. ComponentImage.EncodedWrapper

ImplementsActionSource

A wrapper for ComponentImage to convert it to an EncodedImage.

Methods

public EncodedImage scaledEncoded(int width, int height)Performs scaling using ImageIO to generate an encoded Image
public Image scaled(int width, int height)Returns a scaled version of this image image using the given width and height, this is a fast algorithm that preserves translucent information.
protected Image getInternal()Returns the actual image represented by the encoded image, this image will be cached in a weak/soft reference internally.

Inherited methods

Method details

scaledEncoded

public EncodedImage scaledEncoded(int width, int height)
Performs scaling using ImageIO to generate an encoded Image

Parameters

width int
the width of the image, -1 to scale based on height and preserve aspect ratio
height int
the height of the image, -1 to scale based on width and preserve aspect ratio

Returns

new encoded image

scaled

public Image scaled(int width, int height)
Returns a scaled version of this image image using the given width and height, this is a fast algorithm that preserves translucent information. The method accepts -1 to preserve aspect ratio in the given axis.

Parameters

width int
width for the scaling
height int
height of the scaled image

Returns

new image instance scaled to the given height and width

getInternal

protected Image getInternal()
Returns the actual image represented by the encoded image, this image will be cached in a weak/soft reference internally. This method is useful to detect when the system actually created an image instance. You shouldn’t invoke this method manually!

Returns

drawable image instance