Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

High performance image rendering

895885Oct 24 2011 — edited Feb 3 2012
We have a Swing based application and are looking into JavaFX 2.0 to see if we can change to these new APIs. The application reads a lot of data through a network connection and (among other things) generates bitmaps of 'frames' of this data and displays them on screen. Not all bitmap frames are displayed, but as many as possible to get the view flowing nicely for the user. It uses Graphics2D's drawImage together with a BufferedImage. A couple of questions:

1. How to implement the above features in JavaFX ? I would guess that showing bitmaps this way is standard API features for graphics APIs, but I fail to find something I can use in the JavaFX API. The javafx.scene.image.Image class does not even have a constructor that enables me to set up an image from a byte buffer.

2. As our application adds a lot of processing to each frame that should be displayed, we delay such processing to the Swing paintComponent() method to make sure we only process frames that are actually displayed. (The alternative is to do the processing before calling repaint() on the image, but this adds unneeded processing since repaint requests are collapsed). How to achieve this with JavaFX ? As far as I understand, JavaFX use a 'retained' mode for rendering, which means that I don't actually get any callback when my data is actually rendered.

Regards,
Leif
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 2 2012
Added on Oct 24 2011
4 comments
623 views