2 Replies Latest reply: Jan 7, 2013 12:43 PM by 898076 RSS

    SnapshotParameters obligatory fill

      SnapshotParameters.setFill(null) fills the target image, before drawing into it, with white. Is there any way of retaining the original image?

      The following:
      Group g = new Group();
      g.getChildren().add(new ImageView(base));
      g.getChildren().add(new ImageView(overlay));
      g.snapshot(params, null);
      is very slow.
        • 1. Re: SnapshotParameters obligatory fill

          What I usually do to get the "original" snapshot is by setting the transparent color for the fill:
          SnapshotParameters params = new SnapshotParameters();
          WritableImage wImg = new WritableImage(width, height);
          wImg = g.snapshot(params, wImg);
          I also never pass null as parameters for the snapshot method because it will "fill" the given one.
          • 2. Re: SnapshotParameters obligatory fill
            I tried params.setFill(Color.TRANSPARENT), and the snaphot has indeed transparent background in such a case, but the underlying image is still lost. If the original image was visible in your case, then perhaps it is an inconsistency between platforms? I use Linux, Java 1.7.0_05. If you'd describe your platform, I could post a bug report.