アットウィキロゴ

sちゃ

package cap;
 
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;
import javafx.scene.Group;
import javafx.scene.shape.*;
import static javafx.application.Application.launch;
import javafx.scene.paint.Color;
 import javafx.scene.input.MouseEvent;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.canvas.Canvas;
import javafx.scene.image.PixelReader;
 import javafx.scene.canvas.GraphicsContext;
 
public class pro extends Application {
 
Canvas cam;
GraphicsContext gc;
 
int[][] mr=new int[2000][2000];
int[][] mg=new int[2000][2000];
int[][] mb=new int[2000][2000];
 
 
public static void main(String[] args) {
launch(args);
}
 
 
@Override
public void start(Stage primaryStage) {
 
 
Image im = new Image("file:1.jpg");
 
int h=(int)im.getHeight();
int w=(int)im.getWidth();
 
ImageView imageView = new ImageView();
imageView.setImage(im);
 
 
 
cam = new Canvas(h,w);
gc = cam.getGraphicsContext2D();
 
gc.drawImage(im, 0, 0, w, h ,0, 0, w, h);
 
 
Group root = new Group();
Scene scene = new Scene(root, 1200, 700); 
 
root.getChildren().add(cam);
primaryStage.setTitle("グラフ");
primaryStage.setScene(scene);
primaryStage.show();
 
}
 
 
 
}
最終更新:2016年03月02日 21:48