Class SImageResizer


  • public class SImageResizer
    extends java.lang.Object
    Author:
    Sokkheang.huo
    • Constructor Summary

      Constructors 
      Constructor Description
      SImageResizer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void resize​(java.lang.String inputImagePath, java.lang.String outputImagePath, double percent)
      Resizes an image by a percentage of original size (proportional).
      static void resize​(java.lang.String inputImagePath, java.lang.String outputImagePath, int scaledWidth, int scaledHeight)
      Resizes an image to a absolute width and height (the image may not be proportional)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SImageResizer

        public SImageResizer()
    • Method Detail

      • resize

        public static void resize​(java.lang.String inputImagePath,
                                  java.lang.String outputImagePath,
                                  int scaledWidth,
                                  int scaledHeight)
                           throws java.io.IOException
        Resizes an image to a absolute width and height (the image may not be proportional)
        Parameters:
        inputImagePath - Path of the original image
        outputImagePath - Path to save the resized image
        scaledWidth - absolute width in pixels
        scaledHeight - absolute height in pixels
        Throws:
        java.io.IOException
      • resize

        public static void resize​(java.lang.String inputImagePath,
                                  java.lang.String outputImagePath,
                                  double percent)
                           throws java.io.IOException
        Resizes an image by a percentage of original size (proportional).
        Parameters:
        inputImagePath - Path of the original image
        outputImagePath - Path to save the resized image
        percent - a double number specifies percentage of the output image over the input image.
        Throws:
        java.io.IOException