java
이미지에 캡션 넣기
이미지를 불러와서 상단에 캡션을 넣는 방법이다. 기존 thumbnailator의 filter로 캡션을 넣을 수는 있지만 캡션의 배경색 지정이 안되어서 직접 Graphics를 활용하였다. int WIDTH = 400; int HEIGHT = 400; BufferedImage originalImage = ImageIO.read(new File(filename)); BufferedImage thumbnailImage = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); Graphics2D graphics2D = thumbnailImage.createGraphics(); graphics2D.drawImage(originalImage, 0, 0, WID..
2024. 1. 12. 10:36