Created
June 30, 2019 02:40
-
-
Save jalispran/21cd9ee99440aa6d1f3b2ba5cb15acda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BufferedImage getOverly(String logo) throws IOException { | |
ClassPathResource resource = new ClassPathResource(logo); | |
BufferedImage bufferedImage = ImageIO.read(resource.getInputStream()); | |
int width = bufferedImage.getWidth(); | |
int height = bufferedImage.getHeight(); | |
int newWidth = WIDTH/6; | |
int newHeight = HEIGHT/6; | |
BufferedImage dimg = new BufferedImage(newWidth, newHeight, bufferedImage.getType()); | |
Graphics2D g = dimg.createGraphics(); | |
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); | |
g.drawImage(bufferedImage, 0, 0, newWidth, newHeight, 0, 0, width, height, null); | |
g.dispose(); | |
return dimg; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment