我正在使用ImageViewBuilder创建一个ImageView并且我需要测试属性preserveRatio,fitWidth并且fitheight
我正在查看文档,但仍然无法弄清楚如何。
帮助将不胜感激。这是我的代码(不是 SSCCE)
ImageView img = ImageViewBuilder
.create()
.image(new Image("http://projavafx.com/images/earthrise.jpg")) // path to image
.build();
如果有人可以请更新代码以向我展示如何使用fitHeight()andfitWidth()方法,那将不胜感激。