I want to stretch an image using Graphics, but my code can't here, it shows the image the size I want, but not compressing the image
void imageload () { FileDialog fd = new FileDialog(MainFram.this,"Open", FileDialog.LOAD); fd.show(); if(fd.getFile() == null){ //Label1.setText("You have not chosen any image files yet"); }else{ String d = (fd.getDirectory() + fd.getFile()); Toolkit toolkit = Toolkit.getDefaultToolkit(); Image1 = toolkit.getImage(d); saveImage = d;//if user want to save Image ImageIcon icon=new ImageIcon(Image1); lblImage.setIcon(icon); lblImage.setMinimumSize(new Dimension(50, 70)); lblImage.repaint(); } }
java image-processing
user542719
source share