OffScreen rendering with JavaFX

Hello,
is there a way to render JavaFX to a user-supplied offscreen bufferedImage and be notified when the rendering happens ?
is it possible to frame-step JavaFX by supplying used-defined timers ?
Cheers,
Mik
--

Many thanks,
this is a quick way to take a screenshot.
At the same time we really miss something (an offscreen canvas ?) where the JavaFX output can be redirected.
Imagine you want to use JavaFX inside an OpenGL texture and have it updated frame by frame in synch with your timers.
Also imagine you want to blend lightweight JavaFX scenes on top of normal Swing components.
I think that this is a missing feature of JavaFX. It's kind of show-stopper for us.
Cheers,
Mik

Similar Messages

  • Rendering in JavaFX

    Hi,
    I am currently working on my bachelor thesis about JavaFX 2
    I have a few questions about rendering in JavaFX
    I don’t really understand what the glass toolkit is for and how it’s connected to prism.
    If the glass toolkit is firing the pulse event how does prism know that it has to render a frame?
    And how does the Quantum Toolkit handling the threads?
    And what is the advantage of having two threads (Application and Prism Render Thread) instead of one like in Swing?
    I haven’t found much about rendering in the documentation so please help me. :)

    Hi David,
    Glass is to FX as AWT is to JavaSE. Sort of :-). Glass is our windowing toolkit implementation. It is responsible for showing windows (including Stage, Popup, etc), managing the event queue, passing events up to JavaFX, and setting up timers. Every native application (on Windows, Mac, Linux, etc) has a native event queue. On some platforms like Mac, you get callbacks called whenever an event needs to be handled (that is, the native system pumps the event queue and delivers events to native callback methods). So on Mac Glass, we get these native callbacks, turn them in to JavaFX events, and send them to JavaFX (more or less). On Windows we have to manually pump the event queue, pulling off the event, creating the JavaFX event equivalent, and then pass that up to JavaFX for dispatching.
    Pulse events are normal events on our event queue, but they are generated based on a timer. Glass sets up a timer which fires off every 16.666ms. It is either based on just a hi resolution system timer (native), or it is based on a callback from the OS whenever the video card refresh occurs. This latter mechanism is much more precise, system timers can sometimes drift leading to "jitter" in animations whereas the video card refresh is pretty rock solid. When JavaFX gets notified by glass when the timer fires, it checks to see: is there a pulse already queued up or being handled? If so, don't fire another pulse (keeps us from flooding the event queue with pulses). If the scene is not dirty and there are no animations, then we don't need to handle the pulse. Otherwise if the scene is clean but there are animations, then we handle the pulse. A PulseEvent is then created and put on the event queue.
    During the normal process of handling the events on the event queue, when we encounter a pulse event, we then do the following things:
    - Process animations
    - Process CSS
    - Process Layout
    - Synchronize from the FX scene graph to the render tree (Prism)
    - Pick the scene and update the mouse hover state if a node has moved under the cursor or moved out from under the cursor
    The render thread then goes off and renders after the synchronization step has occurred.
    Quantum is the thing that listens to Glass pulse timer events and creates the PulseEvent and adds it to the event queue, and is also the thing that handles the pulse event, causing animations to be processed and then telling each scene to handle the pulse event (where each scene processes CSS, layout, and synchronizes etc). Quantum then tells the render thread to go off and render.
    Presently in JavaFX, although we have a render thread and application thread, they both essentially run synchronous. I have a patch going into 3.0 as soon as the repo opens that allows us to run multithreaded, where the FX app thread and render thread will be running in parallel except for the brief period of time where they synchronize during the pulse. We have seen 1.5x - 2x performance improvement on tablets by running these threads in parallel. We've also noticed 40%+ performance improvement on desktop in some of the scenarios I've run thus far. Having multiple threads just makes sense in a world where we have multiple cores (even on embedded systems!). Even on a single core, multiple threads might still be advantageous because the CPU doesn't have to wait on memory read operations or GPU operations but can be busy computing the state for the next rendered frame. Having multiple threads does increase the memory overhead, but actually it may not do so very significantly (we have one prototype where we found that the performance cost in constantly converting from FX Color to native Color objects was so bad that caching the converted color object was cheaper anyway, so it isn't clear that even in an immediate-mode style single-threaded rendering system that you'd save much in terms of memory).
    I don't know when your thesis is due by, unfortunately a lot of code in this area hasn't been open sourced yet so you're kind of flying blind. May the decompiler ever guide you ;-)

  • We r using os 10.6.8 and 7.0.3 fcp,in that rendering with unlimited option out of memory warning is displayed Final Cut Pro 7, Mac OS X (10.6.8), 10gb RAM.no stills are there.there are hd standard

    we r using os 10.6.8 and 7.0.3 fcp,in that rendering with unlimited option out of memory warning is displayed, 10gb RAM.no stills are there.there are hd standard videos

    What format are your sources and what are your sequence settings?  I'd guess that you're working with h.264 material which is not fcp friendly.  If so, use compressor to conver to prores422

  • Twitter4j AccesToken with JavaFX Browser

    I want to authentificate a user using an embedded browser with javafx. I can get the PIN (String) that twitter gives me but when I try to create the AccesToken it does not create it correctly. (I can't get my token or tokenSecret, both null).
    I use other browser such as djnativeswing ,it can get AccesToken,but javafx can't.what's the problem?Is it javafx can't support it ? If you know about it ,please tell me,
    thank you very much!

    Hello user,
    The problem may causes from below reasons:
    -Clean the cache of java.
    -Adjust your date and time of your computer
    -Sign the jar
    Thanks
    Narayan

  • Oversize documents being rendered with parts of the document cut off due to the large size

    We are invoking web services on LiveCycle Server ES 8.2 to convert non pdf documents to pdf. We noticed that oversized documents are rendered with parts of it cut off when submitted for conversion.
    Has anyone seen this before and how we can resolve this?
    Thanks in advance.

    The oversized file issue happens when we try to convert legal size documents. Part of the document is cut off.
    Any documents wider than 8 and 1/2 by 11 has this issues.

  • Some Problems Rendering With Maya

    Hi there! I had submitted a Maya job with my Qmaster and it worked fine with my sime animation sequence and putting up basic materials. Now, I have a quite complex scene and it includes materials and textures. Qmaster renders the animation sequence but it only gives me black and white outputs... the textures were not included!
    What seems to be the problem?

    Hi there! I had submitted a Maya job with my Qmaster
    and it worked fine with my sime animation sequence
    and putting up basic materials. Now, I have a quite
    complex scene and it includes materials and textures.
    Qmaster renders the animation sequence but it only
    gives me black and white outputs... the textures were
    not included!
    What seems to be the problem?
    Hi,
    I haven't used qmaster, but i have extensive experience network rendering with maya, so here goes.
    Most likely, your problem is that you are rendering across multiple machines, but the volume names are different. Your file paths must match exactly. For example, on my pc's, all of them have a y: drive. Whenever I need to network render a project, I will just use the y drive and make an exact copy of the directory on each computer. this is also the same format that the renderfarm I use. Unless you have a SAN, you will need to do something similar to this on the mac.
    If you poke around, you should be able to find a log file that will show you that textures could'nt be found (missing), and in that case, the renderer render's black.
    I am interested in qMaster since I have switched my studio over to mac's and need a good network renderer. If you can post your experience when you get a chance i would like to know how it works for you.
    g5 Mac OS X (10.4.6)

  • Starting with JavaFX 2.0 - Any doubts

    I'm starting with JAvaFX 2.0.
    I need to make a application, but a have any doubts.
    - Whats the better, make layouts (Forms) in FXML or JAva Code ? Because, i read any developers prefers use Java Code, to make complex layouts (forms);
    - JavaFX has a Date component ? I have not found it.
    Thanks
    Thiago

    Hi!
    1. I would recommend FXML, because it's much faster to operate with (thanks to Scene Builder -> http://www.oracle.com/technetwork/java/javafx/tools/index.html). Try to check this after you install Scene Builder: http://docs.oracle.com/javafx/scenebuilder/1/overview/jsbpub-overview.htm
    Moreover, by using FXML you split the GUI code and the logic code, making them much easier to maintain and test.
    2. There's no date component in the official JFX 2, but take a look here: http://jfxtras.org/
    Cheers!
    Edited by: zmirc on Jan 19, 2013 11:43 AM
    I forgot a link.

  • "Could not create renderer with alias..." after deploying ResourceRenderer

    Hello everybody
    I've developed a custom ResourceRenderer class that looks like this:
    package no.expert.portal.km.relateddocs;
    import com.sapportals.htmlb.Component;
    import com.sapportals.htmlb.Link;
    import com.sapportals.wcm.WcmException;
    import com.sapportals.wcm.rendering.resource.cm.ResourceRenderer;
    import com.sapportals.wcm.repository.IResource;
    public class RelatedDocsNamePropertyRenderer extends ResourceRenderer
         protected Component renderContentLink(com.sapportals.htmlb.Component comp) throws WcmException
              Link result = (Link) super.renderContentLink(comp);
              result.setTarget("");
              return result;
         protected Component renderContentLink(IResource resource, com.sapportals.htmlb.Component comp) throws WcmException
              Link result = (Link)super.renderContentLink(resource, comp);
              result.setTarget("");
              return result;
    All it does, really, is preventing links to documents in KM to open in a new window. At least that's what I'm hoping it will do, as it's based on ideas in <a href="https://www.sdn.sap.com/irj/sdn/thread?threadID=20316">this post</a>.
    I've added all the necessary .jar files, and implemented a wrapper portal service as described here: <a href="http://media.sdn.sap.com/html/submitted_docs/nw_kmc/ide/projects/Setting%20Up%20a%20KMC%20Project.html">http://media.sdn.sap.com/html/submitted_docs/nw_kmc/ide/projects/Setting%20Up%20a%20KMC%20Project.html</a>.
    I've created an alias for the class in <i>Content Management -> User Interface -> Mapping</i>, and assigned this to the resource renderer settings that I use.
    OK, here is where the trouble starts. When viewing the layout set with debugging on, I check <i>Rendering Information</i>. It informs me that <i>"The given configuration was not used, because the alias is not defined or points to an invalid java class"</i>. Looking in the log, this is the error message:
    Could not create renderer with alias ZRelatedDocsNameResourceRender and classname no.expert.portal.km.relateddocs.RelatedDocsNamePropertyRenderer:java.lang.NoClassDefFoundError: com/sapportals/wcm/rendering/resource/cm/ResourceRenderer
    ------------------------- Loader Info -------------------------
    ClassLoader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@6b247b]
    Parent loader name: [com.sapportals.portal.prt.util.ApplicationClassLoader@4e82c4]
    References:
       not registered!
    Resources:
       C:usrsapEPUJC00j2eeclusterserver0appssap.comirjservlet_jspirjrootWEB-INFportalportalappsno.expert.portal.km.relateddocs.RelatedDocsNamePropertyRendererprivatelibno.expert.portal.km.relateddocs.RelatedDocsNamePropertyRenderercore.jar
    The error occurred while trying to load "no.expert.portal.km.relateddocs.RelatedDocsNamePropertyRenderer".
         at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:389)
    I have a suspicion this might have something to do with the SharingRefernce in portalapp.xml, but after experimenting with different values, I'm no nearer a solution. Any ideas, anyone? Any help greatly appreciated.
    -martin
    Yes, and here is my portalapp.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.netweaver.bc.crt,knowledgemanagement"/>
        <property name="PrivateSharingReference" value="com.sap.km.cm.ui.flex"/>
      </application-config>
      <components>
        <component name="RelatedDocsNamePropertyRenderer">
          <component-config>
            <property name="ClassName" value="no.expert.portal.km.relateddocs.RelatedDocsNamePropertyRenderer"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services>
        <service name="BootStrapNamePropertyRender">
          <service-config>
            <property name="className" value="no.expert.portal.km.relateddocs.BootStrapNamePropertyRender"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>

    Hi Gourab,
    Double check the the page.xml has referring to the correct CO. Open the page.xml and see which controller is attached to it.
    Also attach the extended controller through personalization to the page/Region.
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • We r using os 10.6.8 and 7.0.3 fcp,in that rendering with unlimited option out of memory warning is displayed

    we r using os 10.6.8 and 7.0.3 fcp,in that rendering with unlimited option out of memory warning is displayed

    10gb RAM.no stills are there.there are hd standard i.e 1920*1080.that is only video dvcprohd standard.

  • Playing videos with JavaFX

    Hello,
    I'm trying to add a new functionality to an existent Java application which allows playing local videos.
    First I tried with JMF but I have read in the next web that it's better to do this with JavaFX.
    [http://javatrack.blogspot.com/2009/08/video-in-java-no-more-jmf-please-use.html|http://javatrack.blogspot.com/2009/08/video-in-java-no-more-jmf-please-use.html]
    I want to do this if it's easier than JMF but I was not able to call a JavaFX script from mi Java code.
    Anybody knows if this is posible and relatively easy?
    Thank you very much!

    Have you tried getting info on an affected file (click on a movie file and click Command-I on the keyboard) and then changing the application to open that file type in the Info window? (In the "Open with" section, select Quicktime - navigate to the Quicktime application on your hard drive if necessary.)
    That's the standard Mac method to set what app opens any particular file type (e.g. HTML, PDF, MP3, etc.)
    If the file is on your hard drive rather than a CD, the procedure is to do the above, then click on "Change All" if you want all files of that type to be opened with that application from then on. If it's on a CD, it doesn't allow that, which is fine in this case - it asks if you want to open all files of that type with Quicktime. In that case, click on Continue and you should be all set.
    Do this for each file type (.avi, .mov, and so on) that you want to open with Quicktime. It should stick for all files of that type after you've done this with one file of that type.
    15" MacBook Pro 2.0GHz/100GB (7200rpm)/2GB RAM; Windows XP Pro on Parallels   Mac OS X (10.4.7)   400MHz G4 (Sawtooth); Airport network; 60GB iPod photo; Dell-in-the-Closet

  • I'm having problems with JavaFX applications run on raspberry pi!

    I'm having problems with JavaFX applications run on raspberry pi. I did all the steps of the videos of the course: overclocking, uncommented what I had to uncomment about the framebuffer but Exceptions are still happening. The Fireworks demo example does not work. Someone went through this problem? Java applications are ok. As the versions of java in netbeans project and also on "properties" and they are all JDK 8. So if someone can give a hint, I'm very grateful!

    Can you provide the exceptions you got so I can help you better?
    Would you like to do a coaching session for this?
    -Vinicius

  • Floor layout with JavaFx

    Hi,
    I'm having a requirement to implement an interactive data center floor layout. It should display the different partitions in the data center and should display the server racks installed in them. by clicking on the cubical it should zoom into the racks and once click on the rack it should display the rack layout showing the servers and clicking the server it should display various configurations, etc in the server.
    Can this be achieved with JavaFX and any starting tutorial to implement this would be much appreciated.
    Thanks in advance.
    Dushan

    This can be achieved with JavaFX, but it is quite a bit of work.
    Approach 1:
    Draw your floor layout plan in a vector editor tool (such as Inkscape). Ideally the vector editor should support SVG. Extract the SVGPaths for the individual pieces of your floorplan. You can now recreate those pieces as individual components using SVGPath. Add mouse handling to respond to clicks which then change the position and zoom of the displayed view. Add mouse handling to display detailed configuration info.
    Approach 2:
    Create images for all possible views you will show (the overall floor plan, plus the various zoomed in views). Add mouse handling to respond to mouse clicks and the corresponding navigation logic to take to the different views.
    Honestly approach 2 is probably the easiest, but isn't as 'pure' in that you aren't utilizing vector drawing.

  • How to escape bluecove preverify error on mobile with javaFX?

    Hi all, I'm finding a problem with an application that runs for a standard execution but not on mobile emulator. I am having the following error at execution.
    Error preverifying class com.intel.bluetooth.btgoep.Connection
    java/lang/NoClassDefFoundError: com/ibm/oti/connection/CreateConnection
    ERROR: preverify execution failed, exit code: 1
    I don't know how to go through. I'm using netbeans with javaFx plugins and the application seems to be working with standard execution but not on the mobile emulmator.
    Should anyone have an idea of what is happening here I'll be strongly interested.. Thanks for help.

    The PC10 in vlan 10 can not ping the gateway (10.64.16.1) of vlan 20. It can only ping its own gateway 10.64.8.1
    Both hosts are running Windows 7 professional with firewall turned off.
    The same for the PC20 in vlan 20. It can only ping its own gateway (10.64.16.1) but not vlan10's gateway (10.64.8.1)
    In fact, just for testing purposes.
    I temporarily assign g0/1/2 (which was on vlan20) to vlan10 now. Changed the host (PC20) IP to 10.64.8.3.
    After this change, the 2 hosts can ping each other (in the same vlan 10)....that's expected. So, the OSes and firewalls issues on the hosts are not the issue. They can ping each other when they are in the same vlan.
    However, now that they are in the same vlan, they still can't ping out to G0/0 192.168.0.162.
    So, the problem is how to ping from the layer 2 EHWIC to the built-in G0/0 and G0/1 router ports?

  • No using wiggle effect when rendering with Media Encoder

    Hey!
    I wanted to render my project (by "add AE project") to CS4 media encoder. After the render process
    my wiggle effects which I applied to my footage was not considered and did not appear at all. When I
    just render with AE4 it work.
    Do I need to  change any settings or pick a special format in the media encoder?
    I'd be glad for an answer!
    best,
    Alex

    Unfortunately that is a bug in Adobe Media Encoder - it does not correctly handle expressions, if they were created in the non-default language. If your AE runs in English, but AME in German, AME will run the background instance of AE it uses to handle AE projects also in German and your expressions break, because they are language specific. Nothing you can change. As a workaround, consider using the Convert Expressions to Keyframes keyframe assistant before rendering with AME. For a few layers with simple stuff that should be acceptable, but of course it will be a nightmare with lots of expressions.
    Mylenium

  • Need tech-book style book to learn Netbeans 6.5 with Javafx

    I am having a heck of a time geting started with Netbeans 6.5 JavaFx. Everytime I download code into my IDE I get all types of errors that I can't overcome. I have recently completed a text book course in Java by Lewis and Loftus. The book starts with the basics and work up. Most of the tutorials that I find on JavaFX start with huge amounts of code which is very confusing to people trying to learn this terminology. Can anybody direct me to a tech-book style book on Netbeans 6.5 with JavaFX or is it too early for such a book.

    Any tutorial about JavaFX dated prior to December 8 2008 should be disregarded utterly by a beginner.
    There are significant differences and trying to figure them out from old tutorials is futile!
    Books are coming, search Amazon, there is a title by Weiqi Gao or James Weaver (Jim Weaver).

Maybe you are looking for