Error in saving an Image????
I try to save an image but it does not work...
try{
jLabel3.setIcon(new ImageIcon(zoomOut(ProcessingImages.tmpSideA,8)));
jLabel3.setText("");
javax.imageio.ImageIO.write(ProcessingImages.tmpSi deA, "tstSideA", new File("d:\\yourImageName.JPG"));
}
catch(Exception e){
e.printStackTrace();
}
I wrote above code to save the image when clicking a button. Then the first line executed and image displayed in jLabel3 as it supposed. zoomOut() is used just to reduce the size in 8 times.
In D drive a image file of size 0bytes created but when it clicked to open there were a message displaying
"Windows photo viewer cannot open the file because file is empty"
I hope you could explain me how to correct the error....
Thank you....