Package com.mortennobel.imagescaling

Examples of com.mortennobel.imagescaling.AdvancedResizeOp


      // 获得原始图片的宽度及高度
      int width = originalImage.getWidth();
      int height = originalImage.getHeight();
      // 判断是否有必要缩放
      if (width > 0 || height > 0) {
        AdvancedResizeOp resizeOp = new ThumpnailRescaleOp (newWidth, newHeight);
        resizeOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
        BufferedImage thumbnailImage = resizeOp.filter(originalImage, null);
        ImageIO.write(thumbnailImage, format, thumbnailStream);
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here


            // 获得原始图片的宽度及高度
            int width = originalImage.getWidth();
            int height = originalImage.getHeight();
            // 判断是否有必要缩放
            if (width > 0 || height > 0) {
                AdvancedResizeOp resizeOp = new ThumpnailRescaleOp(newWidth, newHeight);
                resizeOp.setUnsharpenMask(AdvancedResizeOp.UnsharpenMask.Normal);
                BufferedImage thumbnailImage = resizeOp.filter(originalImage, null);
                ImageIO.write(thumbnailImage, format, thumbnailStream);
            }
        } finally {
            if (originalStream != null) {
                originalStream.close();
View Full Code Here

TOP

Related Classes of com.mortennobel.imagescaling.AdvancedResizeOp

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.