ImageShow2.java

   

Contents


ImageShow2.java

 import javafx.application.Application;
 import javafx.scene.Group;
 import javafx.scene.Scene; 
 import javafx.stage.Stage;
 import javafx.scene.paint.Color;
 import java.util.List;

 import java.awt.image.*;


 public class ImageShow2 extends Application {
 
     @Override public void start(Stage stage) {
         // load the image
	 String file1 = "bld.jpg";
	 List<String> args = getParameters().getRaw();
	 String filename =  (args.size()>0)? args.get(0): file1;

	 showImage show1 = new showImage(filename);

	 show1.setStage(stage);

	 stage.setX(100);
	 stage.setY(100);

	 BufferedImage gray = ImageOp.rgb2gray(show1.img);

	 showImage show2 = new showImage(gray,"grayscale image");
	 show2.writeImage("gray");
	 Stage stage2 = new Stage();
	 show2.setStage(stage2);
	 stage2.setX(140+stage.getWidth());
	 stage2.setY(100);

     }

     public static void main(String[] args) {
         Application.launch(args);
     }
}


Maintained by John Loomis, updated Sun Mar 04 19:37:05 2018