JavaFX screenshot SVG

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).

JavaFX screenshot SVG

Postby Fred.M » Sat Mar 26, 2016 10:37 am

Hi,

Is there any possibility to generate a screenshot from javaFX into an SVG picture format ?
May be using intermediate graphic conversions, or by using FX Canvas or by using FXGraphics2D.
Thanks in advance for any help.

Fred
Fred.M
 
Posts: 2
Joined: Sat Mar 26, 2016 10:26 am

Re: JavaFX screenshot SVG

Postby david.gilbert » Wed Mar 30, 2016 6:34 am

Sadly the JavaFX scene graph can't be rendered to an arbitrary graphics target the way that a Swing UI can. Someone asked for the feature a long time ago, but it doesn't seem like it will be added:

https://bugs.openjdk.java.net/browse/JDK-8091853

You have to settle for rendering to an image, which is useful but definitely a backward step compared to what is possible in Swing:

http://code.makery.ch/blog/javafx-2-sna ... png-image/

JFreeSVG is based on the Java2D API. It will only help in JavaFX for elements that you render to a canvas using FXGraphics2D.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11623
Joined: Fri Mar 14, 2003 10:29 am

Re: JavaFX screenshot SVG

Postby Fred.M » Sun Apr 03, 2016 7:12 pm

Thanks for your answer.
I think, I'm going to create a java swing view of my javafx component, before to create a svg picture.

Fred
Fred.M
 
Posts: 2
Joined: Sat Mar 26, 2016 10:26 am


Return to JFreeSVG

Who is online

Users browsing this forum: No registered users and 3 guests