Package org.imgscalr.Scalr

Examples of org.imgscalr.Scalr.Mode


            return Picture.transformFit(source, aspectRatio.getXRatio(), aspectRatio.getYRatio());
        }
    }

    static public BufferedImage fitTo(BufferedImage source, int width, int height) {
        Mode mode;
        if (source.getHeight() > source.getWidth()) {
            mode = Mode.FIT_TO_HEIGHT;
        } else {
            mode = Mode.FIT_TO_WIDTH;
        }
View Full Code Here


      BufferedImage image = ImageIO.read(imageInputStream);
     
      int width = Math.min(image.getWidth(), maxWidth);
      int height = Math.min(image.getHeight(), maxHeight);
     
      Mode mode = Mode.AUTOMATIC;
      if (image.getHeight() > maxHeight) {
        mode = Mode.FIT_TO_HEIGHT;
      }
     
      if (width != image.getWidth() || height != image.getHeight()) {
View Full Code Here

TOP

Related Classes of org.imgscalr.Scalr.Mode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.