アットウィキロゴ

写真2

package imp2;
 
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.shape.*;
import javafx.animation.AnimationTimer;
import static javafx.application.Application.launch;
import javafx.scene.paint.Color;
 import javafx.scene.input.MouseEvent;
import javafx.scene.control.Label;
 
import java.nio.file.Path;
import java.nio.file.Paths;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
 import java.io.File;
import javafx.scene.canvas.Canvas;
 
 import javafx.scene.canvas.GraphicsContext;
 
public class pro extends Application {
 
int time,fire,left,right;
Rectangle gun;
int gx;
Canvas cam;
 GraphicsContext gc;
 
public static void main(String[] args) {
launch(args);
}
 
 
@Override
public void start(Stage primaryStage) {
 
Image im = new Image("file:pic/ren.jpg");
 
ImageView imageView = new ImageView();
imageView.setImage(im);
 
 
cam = new Canvas(500,500);
gc = cam.getGraphicsContext2D();
 
 
 
 gc.drawImage(im, 0, 0);
gc.setFill(Color.RED);
gc.fillRect(100,100,100,100);
 
Group root = new Group();
Scene scene = new Scene(root, 700, 700); 
 
root.getChildren().add(cam);
primaryStage.setTitle("侵略者");
primaryStage.setScene(scene);
primaryStage.show();
 
}
 
 
 
}
最終更新:2014年04月25日 23:51