Skip to main content

draw a scenegraph to an image?

2 replies [Last post]
Anonymous

Is there a way to draw a scenegraph into an image? I'm working on
JavaFX docs and I'd like to automate the process of generating
diagrams. The simplest way to do that is to load up a snippet of
JavaFX Script, render to a buffered image, and then spit out a PNG.
Is this possible?

Thanks,
Josh

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
For additional commands, e-mail: dev-help@scenegraph.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Toula Michael

Josh,

Never actually used FX script but wouldn't be possible to :
1/ Create a BufferedImage
2/ Call createGraphics() on it
3/ Call the render() method on the root SGNode using the Graphics2D
from 2/
4/ use ImageIO.write() to save to PNG

Best,
Mike

On 10 juin 08, at 20:01, Joshua Marinacci wrote:

> Is there a way to draw a scenegraph into an image? I'm working on
> JavaFX docs and I'd like to automate the process of generating
> diagrams. The simplest way to do that is to load up a snippet of
> JavaFX Script, render to a buffered image, and then spit out a
> PNG. Is this possible?
>
> Thanks,
> Josh
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>

**********************************************************
Meet Dalim Software at Drupa 2008

Düsseldorf / Germany, May 29th - June 11th

Hall 9, Booth C44 & Hall 7, Booth 7.0J (JDF Pavillion)
**********************************************************
Michael TOULA
Software Engineer

Dalim Software GmbH
Strassburger Str. 6
D-77694
Kehl am Rhein
GERMANY

tel: +49 7851 919 612
fax: +49 7851 735 76
web: www.dalim.com
**************************************************************
Dalim Software’s mission is the continued development of innovative
solutions that greater facilitate the production workflow throughput
of media communications companies.
Geschäftsführer (CEO): Dr. Carol Werlé Vorsitzender des
Aufsichtsrats (Chairman): Jim D. Salmon
Ust-IdNr. (VAT-Nr.): DE 195 290 616 Sitz der Gesellschaft
(Location): Kehl, Amtsgericht Freiburg, HRB 371620

[att1.html]

Joshua Marinacci

The last time I tried to do this (in December) it didn't work well
because the render method was private and there were issues with
swapping nodes around. I just tried it (now that render() is public)
and it worked beautifully. Even the bounds of the top node were
correct, so I could properly size my image.

- Josh

On Jun 10, 2008, at 11:21 AM, Toula Michael wrote:

> Josh,
>
> Never actually used FX script but wouldn't be possible to :
> 1/ Create a BufferedImage
> 2/ Call createGraphics() on it
> 3/ Call the render() method on the root SGNode using the Graphics2D
> from 2/
> 4/ use ImageIO.write() to save to PNG
>
>
> Best,
> Mike
>
>
> On 10 juin 08, at 20:01, Joshua Marinacci wrote:
>
>> Is there a way to draw a scenegraph into an image? I'm working on
>> JavaFX docs and I'd like to automate the process of generating
>> diagrams. The simplest way to do that is to load up a snippet of
>> JavaFX Script, render to a buffered image, and then spit out a
>> PNG. Is this possible?
>>
>> Thanks,
>> Josh
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@scenegraph.dev.java.net
>> For additional commands, e-mail: dev-help@scenegraph.dev.java.net
>>
>
>
>
> **********************************************************
> Meet Dalim Software at Drupa 2008
>
> Düsseldorf / Germany, May 29th - June 11th
>
> Hall 9, Booth C44 & Hall 7, Booth 7.0J (JDF Pavillion)
> **********************************************************
> Michael TOULA
> Software Engineer
>
> Dalim Software GmbH
> Strassburger Str. 6
> D-77694
> Kehl am Rhein
> GERMANY
>
> tel: +49 7851 919 612
> fax: +49 7851 735 76
> web: www.dalim.com
> **************************************************************
> Dalim Software’s mission is the continued development of innovative
> solutions that greater facilitate the production workflow throughput
> of media communications companies.
> Geschäftsführer (CEO): Dr. Carol Werlé Vorsitzender des
> Aufsichtsrats (Chairman): Jim D. Salmon
> Ust-IdNr. (VAT-Nr.): DE 195 290 616 Sitz der Gesellschaft
> (Location): Kehl, Amtsgericht Freiburg, HRB 371620
>

[att1.html]