0

I'm trying to create a blurred background.

<StackPane id="blurLayer">
   <children>
      <ImageView id="blurImage" fitHeight="478.0" fitWidth="328.0">
         <effect>
            <BoxBlur height="10.0" width="10.0" />
         </effect>
      </ImageView>
   </children>
</StackPane>

The ImageView's image is updated when needed:

SnapshotParameters params = new SnapshotParameters();
params.setFill(Color.web("#242424"));
WritableImage snapshot = gameLayer.snapshot(params, null);
blurImage.setImage(snapshot);

This is the result. But I want this. The blur effect goes out of the ImageView's box. How can I stop it, or crop to its original size?

klenium
  • 2,468
  • 2
  • 24
  • 47

0 Answers0