Saturday, 23 July 2016

Image Saver --Java Programming: Solving Problems with Software


import edu.duke.*;
import java.io.*;
public class imageSaver {
    public void doSave(){
        DirectoryResource dr = new DirectoryResource();
        for(File f : dr.selectedFiles()){
            ImageResource image = new ImageResource(f);
            String fname = image.getFileName();
            String newfname = "copy-" + fname;
            image.setFileName(newfname);
            image.draw();
            image.save();
        }
    }
   
}

No comments:

Post a Comment