Example usage for javafx.scene.image ImageView setEffect

List of usage examples for javafx.scene.image ImageView setEffect

Introduction

In this page you can find the example usage for javafx.scene.image ImageView setEffect.

Prototype

public final void setEffect(Effect value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Title");
    Group root = new Group();
    Scene scene = new Scene(root, 600, 330, Color.WHITE);

    GridPane gridpane = new GridPane();
    gridpane.setPadding(new Insets(5));
    gridpane.setHgap(10);//from  w  w  w.ja v  a  2  s  .  com
    gridpane.setVgap(10);

    final ImageView imv = new ImageView();
    final Image image2 = new Image(Main.class.getResourceAsStream("a.jpg"));
    imv.setImage(image2);

    imv.setEffect(new SepiaTone()); // default is full (1.0) effect

    final HBox pictureRegion = new HBox();

    pictureRegion.getChildren().add(imv);
    gridpane.add(pictureRegion, 1, 1);

    root.getChildren().add(gridpane);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:AudioPlayer3.java

private ImageView createAlbumCover() {
    final Reflection reflection = new Reflection();
    reflection.setFraction(0.2);//from  w ww .ja  va 2  s .  co  m

    final ImageView albumCover = new ImageView();
    albumCover.setFitWidth(240);
    albumCover.setPreserveRatio(true);
    albumCover.setSmooth(true);
    albumCover.setEffect(reflection);

    return albumCover;
}