Class ComponentImage.EncodedWrapper

java.lang.Object
com.codename1.ui.Image
com.codename1.ui.EncodedImage
com.codename1.ui.ComponentImage.EncodedWrapper
All Implemented Interfaces:
ActionSource
Enclosing class:
ComponentImage

public class ComponentImage.EncodedWrapper extends EncodedImage
A wrapper for ComponentImage to convert it to an EncodedImage.
  • Method Details

    • scaledEncoded

      public EncodedImage scaledEncoded(int width, int height)

      Performs scaling using ImageIO to generate an encoded Image

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

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

      Returns

      new encoded image

      Overrides:
      scaledEncoded in class EncodedImage
    • 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: width for the scaling

      • height: height of the scaled image

      Returns

      new image instance scaled to the given height and width

      Overrides:
      scaled in class EncodedImage
    • 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

      Overrides:
      getInternal in class EncodedImage