List of usage examples for javafx.scene.canvas GraphicsContext drawImage
public void drawImage(Image img, double x, double y)
From source file:Main.java
/** * Creates an image canvas with the given width and height. *//* w ww .j av a 2s .c o m*/ public static Canvas createImageCanvas(String url, double width, double height) { ImageView img = new ImageView(new Image(url, width, height, false, true)); final Canvas canvas = new Canvas(width, height); final GraphicsContext gc = canvas.getGraphicsContext2D(); gc.drawImage(img.getImage(), 0, 0); return canvas; }