0

I've seen the usual way of taking a screenshot in Java where you use a Robot and a BufferedImage to take a screenshot. But is there a way of doing this without using Robot and BufferedImage?

Why? I am working with JavaFX and I don't like mixing up AWT (Swing) and JavaFX. Not a big problem, I know, but I would love to keep everything within one library. I've also heard that Robot is a bit slow, but that's not the main reason.

EDIT: I would like to capture the whole screen and not just an area like a scene.

Thanks in advance :D

  • Like this: http://code.makery.ch/blog/javafx-2-snapshot-as-png-image/ ? – PeterMmm Jan 19 '17 at 16:28
  • http://stackoverflow.com/questions/58305/is-there-a-way-to-take-a-screenshot-using-java-and-save-it-to-some-sort-of-image scroll past the first answer to http://stackoverflow.com/a/10796047/6647053 – Zachary Jan 19 '17 at 16:29
  • 1
    Do you want screenshots of your java application only, or also from other parts of the screen ? – Arnaud Jan 19 '17 at 16:30
  • @Berger I want the user to be able to select an area of the screen or the full screen, so definitely other parts as well. –  Jan 19 '17 at 16:31
  • Possible duplicate http://stackoverflow.com/questions/18024498/taking-a-screenshot-of-a-scene-or-a-portion-of-a-scene-in-javafx-2-2 it mentions looking at scene.snapshot() and node.snapshot(). `snapshot(WritableImage image) Takes a snapshot of this scene and returns the rendered image when it is ready.` – XaolingBao Jan 19 '17 at 19:19

0 Answers0