Package com.mortennobel.imagescaling

Examples of com.mortennobel.imagescaling.ResampleOp.filter()


   * Returns an image scaled to the size appropriate for the card picture
   * panel
   */
  public static BufferedImage getResizedImage(BufferedImage original, int width, int height) {
    ResampleOp resampleOp = new ResampleOp(width, height);
    BufferedImage image = resampleOp.filter(original, null);
    return image;
  }

}
View Full Code Here


   * Returns an image scaled to the size appropriate for the card picture
   * panel
   */
  public static BufferedImage getResizedImage(BufferedImage original, int width, int height) {
    ResampleOp resampleOp = new ResampleOp(width, height);
    BufferedImage image = resampleOp.filter(original, null);
    return image;
  }

}
View Full Code Here

                ResampleOp resampleOp = new ResampleOp(with, height);
                BufferedImage origImage;
                try {
                    origImage = ImageIO.read(fileTarget);
                    String ext = FilenameUtils.getExtension(fileTarget.getName());
                    BufferedImage rescaledImage = resampleOp.filter(origImage, null);
                    ImageIO.write(rescaledImage, ext, fileTarget);
                } catch (IOException rescaleEx) {
                    java.util.logging.Logger.getLogger(ResizeCommand.class.getName()).log(Level.SEVERE, null, rescaleEx);
                }
            } else if (mode.equals("crop")) {
View Full Code Here

   
    if (srcWidth == tgtWidth && srcHeight == tgtHeight)
      return original;

    ResampleOp resampleOp = new ResampleOp(tgtWidth, tgtHeight);
    BufferedImage image = resampleOp.filter(original, null);
    return image;
  }

  /**
   * Returns an image scaled to the size appropriate for the card picture
View Full Code Here

   */
  private static BufferedImage getFullSizeImage(BufferedImage original, double scale) {
    if (scale == 1)
      return original;
    ResampleOp resampleOp = new ResampleOp((int) (original.getWidth() * scale), (int) (original.getHeight() * scale));
    BufferedImage image = resampleOp.filter(original, null);
    return image;
  }

  /**
   * Returns an image scaled to the size appropriate for the card picture
View Full Code Here

   * Returns an image scaled to the size appropriate for the card picture
   * panel
   */
  public static BufferedImage getResizedImage(BufferedImage original, Rectangle sizeNeed) {
    ResampleOp resampleOp = new ResampleOp(sizeNeed.width, sizeNeed.height);
    BufferedImage image = resampleOp.filter(original, null);
    return image;
  }

  /**
   * Returns the image appropriate to display the card in the picture panel
View Full Code Here

     * @param height
     * @return
     */
    public static BufferedImage getResizedImage(BufferedImage original, int width, int height) {
        ResampleOp resampleOp = new ResampleOp(width, height);
        BufferedImage image = resampleOp.filter(original, null);
        return image;
    }

    /**
     * Returns an image scaled to fit width
View Full Code Here

     * @param sizeNeed
     * @return
     */
    public static BufferedImage getResizedImage(BufferedImage original, Rectangle sizeNeed) {
        ResampleOp resampleOp = new ResampleOp(sizeNeed.width, sizeNeed.height);
        BufferedImage image = resampleOp.filter(original, null);
        return image;
    }

    /**
     * Get image using relative path in resources.
View Full Code Here

        if (srcWidth == tgtWidth && srcHeight == tgtHeight) {
            return original;
        }

        ResampleOp resampleOp = new ResampleOp(tgtWidth, tgtHeight);
        BufferedImage image = resampleOp.filter(original, null);
        return image;
    }

    /**
     * Returns an image scaled to the size appropriate for the card picture
View Full Code Here

    private static BufferedImage getFullSizeImage(BufferedImage original, double scale) {
        if (scale == 1) {
            return original;
        }
        ResampleOp resampleOp = new ResampleOp((int) (original.getWidth() * scale), (int) (original.getHeight() * scale));
        BufferedImage image = resampleOp.filter(original, null);
        return image;
    }

    /**
     * Returns an image scaled to the size appropriate for the card picture
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.