We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! I think it's more like a JavaFx issue rather then jPro!
The ImageView -> setPreserveRatio(true) is a very nice feature of javafx. But in the case of SVG image, it's not working as expected.
ImageView -> setPreserveRatio(true)
Sample code:
@Override public void start(Stage stage) throws FileNotFoundException { StackPane stackPane = new StackPane(); Image image = new Image("https://images6.alphacoders.com/317/317793.jpg", true); ImageView imageView = new ImageView(new Image("https://www.svgrepo.com/show/512360/image-picture-971.svg")); imageView.setFitWidth(300); imageView.setFitHeight(400); imageView.setPreserveRatio(false); image.progressProperty().addListener((observable, oldValue, newValue) -> { if ((Double) newValue == 1.0 && !image.isError()) { imageView.setImage(image); imageView.setPreserveRatio(true); } }); image.errorProperty().addListener((observable, oldValue, newValue) -> { }); image.exceptionProperty().addListener((observable, oldValue, newValue) -> { }); stackPane.getChildren().add(imageView); Scene scene = new Scene(stackPane); stage.setScene(scene); stage.show(); }
Simple SVG Image with setPreserveRatio(false):
setPreserveRatio(false)
JPG image after finish loading:
Simple SVG Image with setPreserveRatio(true):
setPreserveRatio(true)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! I think it's more like a JavaFx issue rather then jPro!
The
ImageView -> setPreserveRatio(true)
is a very nice feature of javafx. But in the case of SVG image, it's not working as expected.Sample code:
Simple SVG Image with
setPreserveRatio(false)
:JPG image after finish loading:
Simple SVG Image with
setPreserveRatio(true)
:The text was updated successfully, but these errors were encountered: