Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8101893

It should be possible to use GraphicContext2D to render into an Image and save the result.

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7u15
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      All

      Description

      How can I render an image and save the result to an image file without using Swing?
      E.g. making a simple illustrator program with JavaFX is much harder than it should be compared to doing the same with Swing.
       

      There are a few options:
      - PixelWriter could support getGraphicsContext2D()
      - Canvas could support getPixelReader()

      Without one of these there is no reasonable way to render into an Image.

      Then there are issues with saving images in general. ImageIO should be the way to do this, but it doesn't understand JavaFX images and therefore requires conversion to BufferedImages via javafx.embed.swing.SwingFXUtils.fromFXImage. The implications of using javafx.embed.swing.SwingFXUtils are not clearly documented. E.g.: Will this attempt to start up the Swing Event Thread? Could it deadlock on OS X if the application is not a Swing application using JFXPanel?

        Attachments

          Activity

            People

            • Assignee:
              kcr Kevin Rushforth
              Reporter:
              swpalmer Scott Palmer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: