List of usage examples for javafx.scene.image WritableImage WritableImage
public WritableImage(@NamedArg("reader") PixelReader reader, @NamedArg("x") int x, @NamedArg("y") int y, @NamedArg("width") int width, @NamedArg("height") int height)
From source file:Main.java
/** * Returns writable image object that can then be played during gameplay. * @param image the image object * @param x x-coordinate//from w w w . ja v a2 s .c o m * @param y y-coordinate * @param width Width of the window * @param height Height of the window * @return Sub image of the image object */ public static WritableImage getSubImage(Image image, int x, int y, int width, int height) { return new WritableImage(image.getPixelReader(), x, y, width, height); }