package com.aa;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
public class ImageResize {
public static void main(String[] args) throws Exception{
try{
int newWidth=600;
int newHeight=600;
Image image = ImageIO.read(new File("C:\\workspace\\PCM_TIBERO\\WebContent\\file\\ttt.jpg"));
Image resizeImage = image.getScaledInstance(1920, 1000, Image.SCALE_SMOOTH);
BufferedImage newImage = new BufferedImage(1920, 1000, BufferedImage.TYPE_INT_BGR);
Graphics g =newImage.getGraphics();
g.drawImage(resizeImage, 0, 0, null);
g.dispose();
//w=1920
//h=1080
ImageIO.write(newImage, "jpg", new File("C:\\workspace\\PCM_TIBERO\\WebContent\\file\\ttt_new.jpg"));
}catch(Exception e){
}
}
}