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();
        }
    }
   
}

Comments

Popular posts from this blog

The function swapRedGreen has one parameter, a pixel. This function swaps the red and green values and returns the resulting red, green and blue values somehow. Which one of the following is the correct code for this function?