My question concerns rotating the reflection of imageview. Is it possible or not? my code is shown below:
Group root = new Group();
File file = new File("c://Users/Garm/Downloads/AnimGif.gif");
Image image1 = new Image(file.toURI().toString());
ImageView view = new ImageView(image1);
view.setFitHeight(image1.getHeight()/2);
view.setFitWidth(image1.getWidth()/2);
root.getChildren().add(view);
view.setOnMouseClicked(new EventHandler<MouseEvent>()
{
@Override
public void handle(MouseEvent t)
{
System.exit(0);
}
});
Reflection reflection = new Reflection();
reflection.setFraction(1.0);
reflection.setTopOffset(55.5);
reflection.setTopOpacity(0.600);
reflection.setBottomOpacity(0.001);
view.setEffect(reflection);
Scene scene = new Scene(root, image1.getWidth(), image1.getHeight());
stage.setTitle("Animated GIF");
stage.setScene(scene);
stage.initStyle(StageStyle.TRANSPARENT);
stage.show();
In my code, I would like to object reflection was rotated 90 degrees. Whether it is feasible, and if not, can anyone give an idea to solve this problem. Thank you for all your help and guidance on this topic.
Aucun commentaire:
Enregistrer un commentaire