Class ImageUtils

java.lang.Object
be.quodlibet.boxable.utils.ImageUtils

public class ImageUtils extends Object

Utility methods for images

Author:
mkuehne, hstimac
  • Method Details

    • readImage

      public static Image readImage(File imageFile) throws IOException

      Simple reading image from file

      Parameters:
      imageFile - File from which image will be loaded
      Returns:
      Image
      Throws:
      IOException - if loading image fails
    • getScaledDimension

      public static float[] getScaledDimension(float imageWidth, float imageHeight, float boundWidth, float boundHeight)

      Provide an ability to scale Image on desired Dimension

      Parameters:
      imageWidth - Original image width
      imageHeight - Original image height
      boundWidth - Desired image width
      boundHeight - Desired image height
      Returns:
      Array with image dimension. First value is width and second is height.