Simple GIS

GISプログラムの練習

RGB

package face7;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.scene.Group;
import javafx.scene.image.*;
import javafx.scene.shape.Rectangle;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;


public class pro extends Application {
    
    Image img;
    ImageView imv;
    Rectangle r=new Rectangle[500][500]; 
    

    public static void main(String args) {
        launch(args);
    }
    
    
    @Override
public void start(Stage primaryStage) {

        String pic;
        
        pic="http://img.ske48.co.jp/profile/large/matsui_rena.jpg";
        
img = new Image(pic);

imv = new ImageView(img);
imv.setFitWidth(300);
imv.setFitHeight(365);
imv.setLayoutX(50);
imv.setLayoutY(50);

int s,sx;
for(s=1;s<100;s++){
 for(sx=1;sx<100;sx++){  
r[s][sx]=new Rectangle();
r[s][sx].setLayoutX(s);
r[s][sx].setLayoutY(sx);
r[s][sx].setWidth(1);
r[s][sx].setHeight(1);
Color c = Color.rgb(100,100,100);
r[s][sx].setFill(c); 
}
}


Group root = new Group();
Scene scene = new Scene(root, 500, 500);
        
root.getChildren().add(imv);
for(s=1;s<100;s++){
 for(sx=1;sx<100;sx++){  
root.getChildren().add(r[s][sx]);
 }
}
primaryStage.setTitle("face");
primaryStage.setScene(scene);
primaryStage.show();
    }

}