로그인
메뉴
HOME
STUDY
SCS FOOD
DRAWING
MEMO
GS
DIARY
CRIZEL SLM
카테고리1
카테고리1 선택
프로그래밍
카테고리2
카테고리2 선택
AI
CSS
DB
Git
JAVA
JAVASCRIPT
MCP
mysql
NESTJS
REMIX
도커
리액트
리액트 네이티브
미들웨어
브라우저
서버
스벨트킷
스프링
스프링부트
오라클
자바
자바스크립트
플러터
제목
작성자
public String thumbnail(String oriFile, String thumbFile){ String str = ""; try { //썸네일 가로사이즈 int thumbnail_width = 400; //썸네일 세로사이즈 int thumbnail_height = 300; //원본이미지파일의 경로+파일명 File origin_file_name = new File(oriFile); //생성할 썸네일파일의 경로+썸네일파일명 File thumb_file_name = new File(thumbFile); BufferedImage buffer_original_image = ImageIO.read(origin_file_name); BufferedImage buffer_thumbnail_image = new BufferedImage(thumbnail_width, thumbnail_height, BufferedImage.TYPE_3BYTE_BGR); Graphics2D graphic = buffer_thumbnail_image.createGraphics(); graphic.drawImage(buffer_original_image, 0, 0, thumbnail_width, thumbnail_height, null); ImageIO.write(buffer_thumbnail_image, "jpg", thumb_file_name); } catch (Exception e) { str = e.toString(); } return str; }
저장
뒤로가기