Some questions

Jim Graham james.graham at
Mon Aug 11 20:59:22 UTC 2014

On 8/9/14 3:19 PM, Edu García wrote:
> Hi, I have a few questions about JavaFX usage, I hope this is the right
> place to ask them:
> 1. I'm creating a Pane with a lot of shapes and resizing it to 128x128. I'm
> saving it as an image with snapshot() and SwingFXUtils.fromFXImage() (is
> there any other way?). Why is my saved image 129x129, instead of 128x128?

That's the only way currently.  When does it become 129x129?  Is the 
output of snapshot that size?  If it was positioned not on a pixel 
boundary, then it might go from 10.5 to 138.5 and we'd capture all 
pixels from 10 to 139 and get a size of 129.  Is something like that 

> 2. With the same Pane and image, when working on a "Retina" system, the
> output is clearly pixelated, like the real resolution of the image should
> be 64x64. Is this a bug?

That would be a bug.  Is the resulting image 64x64, or 128x128?  We may 
be mis-applying the screen scale when we aren't talking to the screen.

> 3. Non related to the previous, I want to have pixelated rendering (on the
> screen, not to a file) when I modify the scale of my pane or shapes. Is
> there a way of forcing JavaFX to do something like that? Or do I have to
> render to an image at 1:1 resolution, scale that and replace my pane with
> it? I'm assuming that will be a bit slow.

What do you mean by pixelated rendering?  I don't think we provide that, 
but I'm not 100% sure what you want there...


More information about the openjfx-dev mailing list