List of utility methods to do BufferedImage Zoom
BufferedImage | zoomInImage(BufferedImage originalImage, int width, int height) zoom In Image BufferedImage newImage = new BufferedImage(width, height, originalImage.getType()); Graphics g = newImage.getGraphics(); g.drawImage(originalImage, 0, 0, width, height, null); g.dispose(); return newImage; |
void | zoom(BufferedImage srcBufferedImage, File destFile, int destHeight, int destWidth) zoom try { int imgWidth = destWidth; int imgHeight = destHeight; int srcWidth = srcBufferedImage.getWidth(); int srcHeight = srcBufferedImage.getHeight(); if (srcHeight >= srcWidth) { imgWidth = (int) Math.round(((destHeight * 1.0 / srcHeight) * srcWidth)); } else { ... |
void | zoom(String srcImageFile, String result, int destHeight, int destWidth) zoom try { BufferedImage srcBufferedImage = ImageIO.read(new File(srcImageFile)); int imgWidth = destWidth; int imgHeight = destHeight; int srcWidth = srcBufferedImage.getWidth(); int srcHeight = srcBufferedImage.getHeight(); if (srcHeight >= srcWidth) { imgWidth = (int) Math.round(((destHeight * 1.0 / srcHeight) * srcWidth)); ... |