-
Bug
-
Resolution: Fixed
-
P4
-
fx2.0
I created a Scene to wrap a node that I wanted to turn into an image, but the renderToImage() method returned a null.
The examples all use a Scene constructor that specifies a manual width and height and if you do that then it returns an image. But if you want the scene to naturally size itself to the contents then it won't do this for you.
It would seem appropriate for renderToImage() to update any layout and scene sizing issues (and CSS propagation) before it invokes the rendering pass, as if it were preparing for "the next pulse".
A workaround is to execute scene.impl_preferredSize() which internally sizes the scene to match the content, but I don't believe that handles any other layout or CSS issues.
Also, if the size of the Scene is 0x0 then a dummy image should be returned rather than null. If a 0x0 image is invalid then it should return a 1x1 transparent image.
The examples all use a Scene constructor that specifies a manual width and height and if you do that then it returns an image. But if you want the scene to naturally size itself to the contents then it won't do this for you.
It would seem appropriate for renderToImage() to update any layout and scene sizing issues (and CSS propagation) before it invokes the rendering pass, as if it were preparing for "the next pulse".
A workaround is to execute scene.impl_preferredSize() which internally sizes the scene to match the content, but I don't believe that handles any other layout or CSS issues.
Also, if the size of the Scene is 0x0 then a dummy image should be returned rather than null. If a 0x0 image is invalid then it should return a 1x1 transparent image.
- relates to
-
JDK-8114424 CSS is not applied when renderToImage is invoked.
-
- Closed
-
-
JDK-8114654 renderToImage returns null for offline scene without specified size
-
- Closed
-
-
JDK-8114667 renderToImage doesn't layout nodes in scene
-
- Closed
-