# How can I draw something on a JavaFX WritableImage?

I'm migrating a project from Swing to JavaFX, and I have a problem. Since java.awt.BufferedImage provides getGraphics and it has lots of convenient methods (like drawLine, drawImage, etc.), I have some codes that uses these features.

But in JavaFX' WritableImage, I can't find any similar methods.
Did I miss something? Or should I use something else instead of WritableImage?

• If you're going to use a framework you might as well use LibGDX, which is specifically made for creating games and has a lot of active members (like me!) around the 'net. Much more so than JavaFX from what I've seen anyways. – Charanor Nov 26 '17 at 21:38

You can use getGraphics in BufferedImage and do all the drawing job in the BufferedImage, and use SwingFXUtils.toFXImage to convert it into a WritableImage.
Draw everything on a Canvas, and use this:
override val screenCut get() =